-
-
Notifications
You must be signed in to change notification settings - Fork 150
/
invoice.tex
253 lines (191 loc) · 5.86 KB
/
invoice.tex
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
<?lsmb# This is a comment block; it's ignored by the template engine.
Version: 1.2
Date: 2022-07-22
File: invoice.tex
Set: demo
Template version numbers are explicitly not aligned across templates or
releases. No explicit versioning was applied before 2021-01-04.
Version Changes
1.1 Fix spelling mistake (acrue -> accrue)
1.2 Merged xelatex targetting templates with those targetting pdflatex
The "$FORMAT($PROCESSOR)" below evaluates to e.g. "pdf(pdflatex)".
-?>
<?lsmb FILTER latex { format="$FORMAT($PROCESSOR)" };
# Uncomment the next line to overrule the value from System > Defaults;
# The value should be without the 'paper' suffix. E.g. "a4" for "a4paper"
# SETTINGS.papersize = "<your-format>";
INCLUDE "preamble.tex"; -?>
\setlength\LTleft{0pt}
\setlength\LTright{0pt}
\begin{document}
\pagestyle{myheadings}
\thispagestyle{empty}
\ifpdftex
%% (pdf)latex
\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
\fi
<?lsmb BLOCK multiline -?>
\begin{minipage}{2in}
\medskip
\raggedright
<?lsmb string ?>
\end{minipage}
<?lsmb- END -?>
\newsavebox{\ftr}
\sbox{\ftr}{
\parbox{\textwidth}{
\tiny
\rule[1.5em]{\textwidth}{0.5pt}
<?lsmb text('Payment due NET [_1] Days from date of Invoice.', terms) ?>
<?lsmb text('Interest on overdue amounts will accrue at the rate of 12% per annum starting from [_1] until paid in full. Items returned are subject to a 10% restocking charge.', duedate) ?>
<?lsmb text('A return authorization must be obtained from [_1] before goods are returned. Returns must be shipped prepaid and properly insured. [_1] will not be responsible for damages during transit.', company) ?>
}
}
<?lsmb INCLUDE letterhead ?>
\markboth{<?lsmb company ?>\hfill <?lsmb invnumber ?>}{<?lsmb company ?>\hfill <?lsmb invnumber ?>}
\vspace*{0.5cm}
\parbox[t]{.5\textwidth}{
\textbf{To}
\vspace{0.3cm}
<?lsmb name ?>
<?lsmb address1 ?>
<?lsmb address2 ?>
<?lsmb city ?>
<?lsmb IF state -?>
\hspace{-0.1cm}, <?lsmb state ?> <?lsmb END ?> <?lsmb zipcode ?>
<?lsmb country ?>
\vspace{0.3cm}
<?lsmb IF contact ?>
<?lsmb contact ?>
\vspace{0.2cm}
<?lsmb END ?>
<?lsmb IF customerphone ?>
Tel: <?lsmb customerphone ?>
<?lsmb END ?>
<?lsmb IF customerfax ?>
Fax: <?lsmb customerfax ?>
<?lsmb END ?>
<?lsmb email ?>
}
\parbox[t]{.5\textwidth}{
\textbf{<?lsmb text('Ship To') ?>}
\vspace{0.3cm}
<?lsmb shiptoname ?>
<?lsmb shiptoaddress1 ?>
<?lsmb shiptoaddress2 ?>
<?lsmb shiptocity ?>
<?lsmb IF shiptostate -?>
\hspace{-0.1cm}, <?lsmb shiptostate ?><?lsmb END ?> <?lsmb shiptozipcode ?>
<?lsmb shiptocountry ?>
\vspace{0.3cm}
<?lsmb IF shiptocontact ?>
<?lsmb shiptocontact ?>
\vspace{0.2cm}
<?lsmb END ?>
<?lsmb IF shiptophone ?>
Tel: <?lsmb shiptophone ?>
<?lsmb END ?>
<?lsmb IF shiptofax ?>
Fax: <?lsmb shiptofax ?>
<?lsmb END ?>
<?lsmb shiptoemail ?>
}
\hfill
\vspace{1cm}
\textbf{\MakeUppercase{<?lsmb
IF reverse;
text('Credit Invoice');
ELSE;
text('Invoice');
END; ?>}}
\hfill
\vspace{1cm}
\begin{tabularx}{\textwidth}{*{7}{|X}|} \hline
\textbf{<?lsmb text('Invoice #') ?>} & \textbf{<?lsmb text('Date') ?>}
& \textbf{<?lsmb text('Due') ?>} & \textbf{<?lsmb text('Order #') ?>}
& \textbf{<?lsmb text('Salesperson') ?>}
& \textbf{<?lsmb text('Shipping Point') ?>}
& \textbf{<?lsmb text('Ship via') ?>} \\ [0.5em]
\hline
<?lsmb invnumber ?> & <?lsmb invdate ?> & <?lsmb duedate ?> & <?lsmb ordnumber ?> & <?lsmb employee ?>
& <?lsmb shippingpoint ?> & <?lsmb shipvia ?> \\
\hline
\end{tabularx}
\vspace{1cm}
\begin{longtable}{@{\extracolsep{\fill}}r|llcrlrr|r}
\textbf{<?lsmb text('Item') ?>}
& \textbf{<?lsmb text('Number') ?>}
& \textbf{<?lsmb text('Description') ?>}
& \textbf{<?lsmb text('Delivery') ?>}
& \textbf{<?lsmb text('Qty') ?>}
& \textbf{<?lsmb text('Unit') ?>}
& \textbf{<?lsmb text('Price') ?>}
& \textbf{<?lsmb text('Disc %') ?>}
& \textbf{<?lsmb text('Amount') ?>} \\
\hline
\endhead
<?lsmb FOREACH number ?>
<?lsmb lc = loop.index ?>
<?lsmb runningnumber.${lc} ?> &
<?lsmb number.${lc} ?> &
<?lsmb INCLUDE multiline string = item_description.${lc} ?> &
<?lsmb deliverydate.${lc} ?> &
<?lsmb qty.${lc} ?> &
<?lsmb unit.${lc} ?> &
<?lsmb sellprice.${lc} ?> &
<?lsmb discountrate.${lc} ?> &
<?lsmb linetotal.${lc} ?> \\
<?lsmb END ?>
<?lsmb IF tax ?>
\hline \hline
\multicolumn{8}{r|}{<?lsmb text('Subtotal') ?>} & <?lsmb subtotal ?> \\*
<?lsmb FOREACH tax ?>
<?lsmb lc = loop.index ?>
\multicolumn{8}{r|}{<?lsmb taxdescription.${lc}
?> on <?lsmb taxbase.${lc} ?> }
& <?lsmb tax.${lc} ?> \\*
<?lsmb END ?>
<?lsmb END ?>
\hline \hline
\multicolumn{8}{r|}{<?lsmb text('Total') ?>} & <?lsmb invtotal ?> \\*
<?lsmb IF paymentdate.0 ?>
\multicolumn{8}{r|}{ <?lsmb text('Paid') ?> } & - <?lsmb paid ?> \\*
\hline
\hline
\multicolumn{8}{r|}{<?lsmb text('Balance') ?>} & <?lsmb total ?>\\
<?lsmb END ?>
\end{longtable}
\parbox{\textwidth}{
\vspace{0.2cm}
\hfill
\vspace{0.3cm}
<?lsmb text_amount ?> ***** <?lsmb decimal ?>/100
\hfill
<?lsmb text('All prices in [_1].', currency) ?>
\vspace{12pt}
<?lsmb FOREACH P IN notes.split('\n\n+') ?>
<?lsmb P ?>\medskip
<?lsmb END ?>
}
\vfill
<?lsmb IF paymentdate.0 ?>
\begin{tabularx}{10cm}{@{}lXlr@{}}
\textbf{<?lsmb text('Payments') ?>} & & & \\
\hline
\textbf{<?lsmb text('Date') ?>} & & \textbf{<?lsmb text('Source') ?>}
& \textbf{<?lsmb text('Amount') ?>} \\
<?lsmb FOREACH payment ?>
<?lsmb lc = loop.index ?>
<?lsmb paymentdate.${lc} ?> & <?lsmb paymentaccount.${lc} ?> & <?lsmb paymentsource.${lc} ?> & <?lsmb payment.${lc} ?> \\
<?lsmb END ?>
\end{tabularx}
<?lsmb END ?>
<?lsmb FOR FILE IN file_list ?>
\includegraphics[scale=0.3]{<?lsmb file_path _ '/' _ FILE.file_name ?>}
<?lsmb END ?>
\vspace{1cm}
\centerline{\textbf{<?lsmb text('Thank You for your valued business!') ?>}}
\rule{\textwidth}{0.5pt}
\usebox{\ftr}
\end{document}
<?lsmb END -?>