-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathnewspaper.html
258 lines (258 loc) · 10.4 KB
/
newspaper.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="pdfkit-page_size" content="A4">
<meta name="pdfkit-margin_top" content="13mm">
<meta name="pdfkit-margin_right" content="13mm">
<meta name="pdfkit-margin_bottom" content="13mm">
<meta name="pdfkit-margin_left" content="13mm">
<title>{{document.number}}</title>
<style>
body {padding: 20px; background: #fff; color:#000; font:normal 100% Georgia, "Times New Roman", Times, serif}
#header {padding:20px 0 0}
#items, #footer {padding:40px 0 0}
#header table, #items table, #footer table {margin:0 auto}
.table-block {border:none; border-collapse:collapse}
h1, h2 {text-transform:uppercase; color:#4d4d4d; font-weight:normal; margin:0}
h1 {font-size:32px; border-bottom:1px solid #ccc}
h2 {font-size:11px}
h3 {margin:5px 0 0; font:24px Impact, Charcoal, sans-serif; line-height:1; color: {{account.color_scheme}};}
p {margin:0}
a:link, a:visited {color:#000; text-decoration:none}
a:hover {color:#000; text-decoration:none}
.w14 {width:14px}
.w92 {width:92px}
.w124 {width:124px}
.w138 {width:138px}
.w170 {width:170px}
.w216 {width:216px}
.w262 {width:262px}
.w300 {width:300px}
.w308 {width:308px}
.w322 {width:322px}
.h27 {height:27px}
.valign-bottom {vertical-align:bottom}
.valign-top {vertical-align:top}
.subject {font-style:italic}
.verification-code {text-align:right}
address {color:#4d4d4d; font-style:italic; font-size:14px}
.line {border-top:1px solid #ccc}
.document-data, .contact-data {padding-top:10px}
.document-data h2.line, .contact-data address {padding-top:10px}
.document-data p {margin-bottom:10px; font-size:14px; color:#4d4d4d}
.document-data p.small {margin-top:-10px; font-size:11px}
.contact-data p {margin:6px 0 0; font-size:14px; color:#4d4d4d}
#items {min-height:385px}
#items table thead tr th, #items table tfoot tr td, #items table tbody tr td {padding:6px 0; font:11px Georgia, "Times New Roman", Times, serif; color:#4d4d4d; line-height:1.4}
#items table thead tr th {background-color: {{account.color_scheme}}; color:#fff; font:normal 11px Georgia, "Times New Roman", Times, serif; text-transform:uppercase}
#items table tfoot tr td.label, #items table tfoot tr td.label-total {text-transform:uppercase}
#items table tfoot tr td.right {text-align:right}
.border {border-bottom:1px solid #ccc}
.paid {padding:5px 0; border-top:2px solid #000; border-bottom:2px solid #000; font:bold 18px Impact, Charcoal, sans-serif; text-transform: uppercase}
#items table tfoot tr td.label-total, #items table tfoot tr td.value-total {border-top:1px solid #4d4d4d; border-bottom:1px solid #4d4d4d; font:19px Impact, Charcoal, sans-serif; color: {{account.color_scheme}};}
#items table tfoot tr td.label-total {text-transform:none}
#items table tfoot tr td.value-total abbr {font-size:16px}
#items table tfoot tr td.topspace14 {padding-top:14px}
#items table tbody tr td {border-bottom:1px solid #ccc}
#items table thead tr th.description, #items table tbody tr td.description {padding-left:6px; padding-right:14px; text-align:left}
#items table tbody tr td.description {font-style:italic}
#items table thead tr th.quantity, #items table tbody tr td.quantity {padding-right:14px; text-align:right}
#items table thead tr th.price, #items table tbody tr td.price {padding-right:14px; text-align:right}
#items table thead tr th.amount, #items table tfoot tr td.value, #items table tfoot tr td.value-total, #items table tbody tr td.amount {padding-right:6px; text-align:right}
#footer .user, #footer .notes, #footer .payment, #footer .legal {padding-top:10px; border-top: 1px solid #ccc}
#footer h3 {font:normal 16px Georgia, "Times New Roman", Times, serif; text-transform:uppercase; color:#4d4d4d}
#footer p, #footer address {margin-top:6px; font:italic 11px Georgia, "Times New Roman", Times, serif; line-height:1.4; color:#4d4d4d}
#footer address {line-height:1}
#footer p a {color:#4d4d4d; text-decoration:none}
#footer .legal p {font-style:normal}
/* css rules for printing */
@media print {
body {-webkit-print-color-adjust:exact}
#items tr {page-break-inside:avoid}
#items tfoot {display:table-row-group}
}
</style>
</head>
<body>
<div id="header">
<table class="table-block">
<tr>
<td class="w262 valign-top" rowspan="2">
<!-- logo -->
{% if account.logo_url != blank %}
<img src="{{ account.logo_url}}" class="w262" alt="Logo">
{% endif %}
</td>
<td class="w14" rowspan="2"> </td>
<td colspan="3">
<h1>{{title}}</h1>
</td>
</tr>
<tr>
<td class="document-data w124 valign-top">
<!-- document data -->
<h2>{{labels.number}}</h2>
<p>{{document.number}}</p>
<h2 class="line">{{labels.issue_date}}</h2>
<p>{{document.issue_date | date:'long'}}</p>
{% if document.po_number != blank %}
<h2 class="line">{{labels.po_number}}:</h2>
<p>{{document.po_number}}</p>
{% endif %}
{% if document.due_date != blank %}
<h2 class="line">{{labels.due_date}}</h2>
<p>{{document.due_date | date:'long'}}</p>
{% endif %}
{% if document.related_document_type != blank %}
<h2 class="line">{{labels.related_document}}</h2>
<p>{{document.related_document_type | localize_document_type: labels}} {{document.related_document_number}}</p>
<p class="small">{{document.related_document_date | date: 'default', contact.country}}</p>
{% endif %}
{% if document.valid_until != blank %}
<h2 class="line">{{labels.valid_until}}</h2>
<p>{{document.valid_until | date:'long'}}</p>
{% endif %}
{% if document.subject != blank %}
<h2 class="line">{{labels.subject}}</h2>
<p class="subject">{{ document.subject }}</p>
{% endif %}
</td>
<td class="w14"> </td>
<td class="contact-data w262 valign-top">
<!-- contact's data -->
<h2>{{labels.to}}</h2>
<h3>{{ document.contact }}</h3>
{% if document.tax_id != blank %}<p>{{labels.tax_id}}: {{document.tax_id}}</p>{% endif %}
<address>{{ document.billing_address | newline_to_br }}</address>
</td>
</tr>
</table>
</div>
<div id="items">
<!-- items -->
<table class="table-block">
<thead>
<tr>
<th class="description w322" scope="col">{{labels.description}}</th>
<th class="quantity w92">{{labels.quantity}}</th>
<th class="price w138">{{labels.unit_price}}</th>
<th class="amount w170">{{labels.amount}}</th>
</tr>
</thead>
<tbody>
{% for item in document.items %}
<tr>
<td class="description w322 valign-top">{{item.description}}</td>
<td class="quantity w92 valign-top">{{item.quantity | precision}}</td>
<td class="price w138 valign-top">{{item.unit_price | money}}</td>
<td class="amount w170 valign-top"><strong>{{item.subtotal | money}}</strong></td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td class="w322"> </td>
<td class="w92"> </td>
<td class="label border w138 valign-top">{{labels.subtotal}}</td>
<td class="value border w170 valign-top"><strong>{{document.subtotal | money}}</strong></td>
</tr>
{% if document.discount > 0 %}
<tr>
<td class="w322"> </td>
<td class="w92"> </td>
<td class="label border w138 valign-top">{{labels.discount}}</td>
<td class="value border w170 valign-top"><strong>{{document.discount | money}}</strong></td>
</tr>
{% endif %}
{% for tax in document.taxes %}
<tr>
<td class="w322"> </td>
<td class="w92"> </td>
<td class="label w138 valign-top">{{tax.label}}</td>
<td class="value w170 valign-top">
<strong>{{tax.amount | money}}</strong>
{% if tax.currency != document.currency %} ({{tax.local_amount | money}}){% endif %}
</td>
</tr>
{% endfor %}
<tr>
<td class="w322"> </td>
<td class="w92"> </td>
<td class="label-total w138 valign-top">{{labels.total}} ({{document.currency}})</td>
<td class="value-total w170 valign-top"><strong>{{document.total | money}}</strong></td>
</tr>
{% if document.state == "paid" %}
<!-- paid state -->
<tr>
<td colspan="4" class="topspace14"> </td>
</tr>
<tr>
<td class="w322"> </td>
<td class="w92"> </td>
<td class="w138"> </td>
<td class="right w170 valign-top"><span class="paid">{{ labels.paid }}<span></td>
</td>
</tr>
{% endif %}
</tfoot>
</table>
</div>
<div id="footer">
<!-- footer -->
<table class="table-block">
<tr>
<td class="user w216 valign-top">
<!-- user data -->
<h2>{{labels.from}}</h2>
<h3>{{account.full_name}}</h3>
{% if account.tax_id != blank %}<p>{{labels.tax_id}}: {{account.tax_id}}</p>{% endif %}
<address>{{ account.formatted_address | newline_to_br }}</address>
{% if account.phone_1 %}<p>{{labels.phone}}: {{account.phone_1}}</p>{% endif %}
{% if account.email != blank %}<p><a href="mailto:{{account.email}}">{{ account.email }}</a></p>{% endif %}
{% if account.web != blank %}<p><a href="{{account.web}}">{{ account.web }}</a></p>{% endif %}
</td>
<td class="w14"> </td>
<td class="notes w216 valign-top">
{% if document.notes != blank %}
<!-- notes -->
<h2>{{labels.notes}}</h2>
{{document.notes | textilize}}
{% endif %}
</td>
<td class="w14"> </td>
<td class="payment w216 valign-top">
{% if document.payment_details != blank %}
<!-- payment details -->
<h2>{{labels.payment_details}}</h2>
{{document.payment_details | textilize}}
{% elsif document.state == "paid" %}
<h2>{{labels.payment_details}}</h2>
{% assign payment = document.payments | last %}{{ payment.payment_method_text | textilize }}
{% endif %}
</td>
</tr>
<!-- legal notes -->
{% if document.legal != blank %}
<tr>
<td class="h27" colspan="5"> </td>
</tr>
<tr>
<td colspan="5" class="legal valign-top">
<p>{{document.legal | textilize}}</p>
</td>
</tr>
{% endif %}
{% if document.verification_code %}
<tr>
<td colspan="4"> </td>
<td class="valign-top verification-code">
<p>{{document.verification_code}}</p>
{{document.verification_permalink}}
</td>
</tr>
{% endif %}
</table>
</div>
</body>
</html>