-
Notifications
You must be signed in to change notification settings - Fork 15
/
minimal.html
172 lines (172 loc) · 6.99 KB
/
minimal.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
<!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 10pt Arial, Helvetica, sans-serif}
#content {min-height:850px}
h1 {font-size:38pt; color:{{account.color_scheme}}}
p {margin:2px 0}
a:link, a:visited {color:#000; text-decoration:none}
a:hover {color:#000; text-decoration:none}
address {font-style:normal}
table {width:100%; border:none; font-size:100%}
table#items {margin:25px 0; border-collapse:collapse}
table#items thead tr th {padding:5px; color:#fff; background-color:{{account.color_scheme}}}
table#items tbody tr td {padding:5px; border-bottom:1px solid {{account.color_scheme}}}
table#items tfoot tr td {padding:0 5px; border-bottom: 2px solid {{account.color_scheme}}; text-align:right}
#footer {text-align:center; color:#666; font-size:8pt}
#footer a {color:#666;}
#legal {margin:20px 0}
.w200 {width:200px}
.w60per {width:60%}
.right {text-align:right}
.center {text-align:center}
.topspace10 {padding-top:10px}
.paid {padding:5px 0; border-top:2px solid {{account.color_scheme}}; border-bottom:2px solid {{account.color_scheme}}; font-size: 16pt; font-weight: bold; text-transform: uppercase}
/* 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="content">
<table>
{% if account.logo_url != blank %}
<tr>
<!-- logo -->
<td colspan="2"><img src="{{ account.logo_url }}" class="w200" align="Logo"></td>
</tr>
{% endif %}
<tr>
<!-- contact's data -->
<td colspan="2" class="right">
<p><strong>{{ document.contact }}</strong></p>
{% if document.tax_id != blank %}<p>{{labels.tax_id}}: {{document.tax_id}}</p>{% endif %}
<address>{{ document.billing_address | newline_to_br }}</address>
</td>
</tr>
{% if document.state == "paid" %}
<tr>
<!-- paid state -->
<td colspan="2" class="right topspace10">
<span class="paid">{{ labels.paid }}<span>
</td>
</tr>
{% endif %}
<tr>
<!-- document type -->
<td colspan="2" class="center">
<h1>{{title}}</h1>
</td>
</tr>
<tr>
<td>
<!-- basic data -->
<strong>{{labels.number}}: </strong>{{document.number}}
<br /><strong>{{labels.issue_date}}: </strong>{{document.issue_date | date:'long'}}
{% if document.related_document_type != blank %}
<br /><strong>{{labels.related_document}}:</strong>
{{document.related_document_type | localize_document_type: labels}} {{document.related_document_number}}
({{document.related_document_date | date: 'default', contact.country}})
{% endif %}
{% if document.po_number != blank %}<br /><strong>{{labels.po_number}}: </strong>{{document.po_number}}{% endif %}
{% if document.subject != blank %}<br /><strong>{{labels.subject}}: </strong>{{ document.subject }}{% endif %}
</td>
<td> </td>
</tr>
<tr>
<td colspan="2">
<!-- items table -->
<table id="items">
<thead>
<tr>
<th class="w60per">{{labels.description}}</th>
<th class="right">{{labels.quantity}}</th>
<th class="right">{{labels.unit_price}}</th>
<th class="right">{{labels.amount}}</th>
</tr>
</thead>
<tbody>
{% for item in document.items %}
<tr>
<td>{{item.description}}</td>
<td class="right">{{item.quantity | precision}}</td>
<td class="right">{{item.unit_price | money}}</td>
<td class="right">{{item.subtotal | money}}</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td colspan="4">
<p>{{labels.subtotal}}: {{document.subtotal | money}}</p>
{% if document.discount > 0 %}<p>{{labels.discount}}: {{document.discount | money}}</p>{% endif %}
{% for tax in document.taxes %}
<p>
{{tax.label}}: {{tax.amount | money}}
{% if tax.currency != document.currency %} ({{tax.local_amount | money}}){% endif %}
</p>
{% endfor %}
<p>{{labels.total}} ({{document.currency}}): {{document.total | money}}</p>
</td>
</tr>
</tfoot>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<!-- other data -->
<p>
{% if document.due_date != blank %}
<strong>{{labels.due_date}}: </strong>{{document.due_date | date:'long'}}<br/>
{% endif %}
{% if document.valid_until != blank %}
<strong>{{labels.valid_until}}: </strong>{{document.valid_until | date:'long'}}<br/>
{% endif %}
{% if document.payment_details != blank %}
<strong>{{labels.payment_details}}: </strong>{{document.payment_details | textilize}}<br/>
{% elsif document.state == "paid" %}
<strong>{{labels.payment_details}}: </strong>{% assign payment = document.payments | last %}{{ payment.payment_method_text | textilize }}<br/>
{% endif %}
{% if document.notes != blank %}
<strong>{{labels.notes}}: </strong>{{document.notes | textilize}}
{% endif %}
</p>
</td>
</tr>
</table>
</div>
<div id="footer">
<!-- account's data -->
<p><strong>{{account.full_name}} {% if account.tax_id != blank %}– {{labels.tax_id}}: {{account.tax_id}}{% endif %}</strong></p>
<address>{{ account.formatted_address | newline_to_br | strip_newlines | replace: "<br />", " – " }}</address>
<p>
{% if account.phone_1 != blank %}{{labels.phone}}: {{account.phone_1}} {% endif %}
{% if account.email != blank %} {{labels.email}}: <a href="mailto:{{account.email}}">{{ account.email }}</a> {% endif %}
{% if account.web != blank %} <a href="{{account.web}}">{{ account.web }}</a>{% endif %}
</p>
<!-- legal notes -->
{% if document.legal != blank %}
<p id="legal">{{document.legal | textilize}}</p>
{% endif %}
{% if document.verification_code %}
<br>
<p class="right">
{{document.verification_code}} <br><br><br>
{{document.verification_permalink}}
</p>
{% endif %}
</div>
</body>
</html>