add some time-worked reporting
[freeside.git] / sql-ledger / templates / Default-invoice.tex
1 \documentclass[10pt,letterpaper,oneside,onecolumn]{scrartcl}
2 \usepackage[frame]{xy}
3 \usepackage{tabularx}
4 \usepackage[latin1]{inputenc}
5 \usepackage{graphicx}
6 \setlength{\voffset}{0.5cm}
7 \setlength{\hoffset}{-1.9cm}
8 \setlength{\topmargin}{0cm}
9 \setlength{\headheight}{0.5cm}
10 \setlength{\headsep}{1cm}
11 \setlength{\topskip}{0pt}
12 \setlength{\oddsidemargin}{1.0cm}
13 \setlength{\evensidemargin}{1.0cm}
14 \setlength{\textwidth}{19.2cm}
15 \setlength{\textheight}{24.7cm}
16 \setlength{\footskip}{1cm}
17 \setlength{\parindent}{0pt}
18 \renewcommand{\baselinestretch}{1}
19
20 \begin{document}
21
22 \pagestyle{myheadings}
23 \thispagestyle{empty}
24
25 \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
26
27 \newsavebox{\ftr}
28 \sbox{\ftr}{
29   \parbox{\textwidth}{
30   \tiny
31   \rule[1.5em]{\textwidth}{0.5pt}
32 Payment due NET <%terms%> Days from date of Invoice. Interest on overdue amounts will acrue at the rate of 12\% per annum starting from <%duedate%> until paid in full. Items returned are subject to a 10\% restocking charge.
33 A return authorization must be obtained from <%company%> before goods are returned. Returns must be shipped prepaid and properly insured.
34 <%company%> will not be responsible for damages during transit.
35   }
36 }
37
38 \vspace*{-1.3cm}
39
40 \parbox{\textwidth}{%
41   \parbox[b]{.42\textwidth}{%
42     <%company%>
43    
44     <%address%>
45   }
46   \parbox[b]{.2\textwidth}{
47     \includegraphics[scale=0.3]{sql-ledger}
48   }\hfill
49   \begin{tabular}[b]{rr@{}}
50   Telephone & <%tel%>\\
51   Facsimile & <%fax%>
52   \end{tabular}
53
54   \rule[1.5em]{\textwidth}{0.5pt}
55 }
56
57
58 <%pagebreak 90 27 37%>
59 \end{tabularx}
60
61   \rule{\textwidth}{2pt}
62   
63   \hfill
64   \begin{tabularx}{7cm}{Xr@{}}
65   \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
66   \end{tabularx}
67
68 \newpage
69
70 \markboth{<%company%>\hfill <%invnumber%>}{<%company%>\hfill <%invnumber%>}
71
72 \vspace*{-12pt}
73
74 \begin{tabularx}{\textwidth}{@{}rlXlrlrrr@{}}
75   \textbf{Pos} & \textbf{Number} & \textbf{Description} & & \textbf{Qt'y} &
76     \textbf{Unit} & \textbf{Price} & \textbf{Disc \%} & \textbf{Amount} \\ [0.5em]
77   & carried forward from page <%lastpage%> & & & & & & <%sumcarriedforward%> \\ [0.5em]
78 <%end pagebreak%>
79
80
81 \vspace*{0.5cm}
82
83 \parbox[t]{1cm}{\hfill}
84 \parbox[t]{.6\textwidth}{
85 \textbf{To}
86 \vspace{0.7cm}
87
88 <%name%>
89
90 <%address1%>
91
92 <%address2%>
93
94 <%city%> <%state%> <%zipcode%>
95
96 <%country%>
97
98 \vspace{0.3cm}
99
100 <%if contact%>
101 <%contact%>
102 \vspace{0.2cm}
103 <%end contact%>
104
105 <%if customerphone%>
106 Tel: <%customerphone%>
107 <%end customerphone%>
108
109 <%if customerfax%>
110 Fax: <%customerfax%>
111 <%end customerfax%>
112
113 <%email%>
114 }
115 \parbox[t]{.4\textwidth}{
116 \textbf{Ship To}
117 \vspace{0.7cm}
118
119 <%shiptoname%>
120
121 <%shiptoaddress1%>
122
123 <%shiptoaddress2%>
124
125 <%shiptocity%> <%shiptostate%> <%shiptozipcode%>
126
127 <%shiptocountry%>
128
129 \vspace{0.3cm}
130
131 <%if shiptocontact%>
132 <%shiptocontact%>
133 \vspace{0.2cm}
134 <%end shiptocontact%>
135
136 <%if shiptophone%>
137 Tel: <%shiptophone%>
138 <%end shiptophone%>
139
140 <%if shiptofax%>
141 Fax: <%shiptofax%>
142 <%end shiptofax%>
143
144 <%shiptoemail%>
145 }
146 \hfill
147
148 \vspace{1cm}
149
150 \textbf{I N V O I C E}
151 \hfill
152
153 \vspace{1cm}
154
155 \begin{tabularx}{\textwidth}{*{7}{|X}|} \hline
156   \textbf{Invoice \#} & \textbf{Date} & \textbf{Due} & \textbf{Order \#}
157   & \textbf{Salesperson} & \textbf{Shipping Point} &
158   \textbf{Ship via} \\ [0.5em]
159   \hline
160   <%invnumber%> & <%invdate%> & <%duedate%> & <%ordnumber%> & <%employee%>
161   & <%shippingpoint%> & <%shipvia%> \\
162   \hline
163 \end{tabularx}
164
165 \vspace{1cm}
166
167 \begin{tabularx}{\textwidth}{@{}rlXlrlrrr@{}}
168   \textbf{Pos} & \textbf{Number} & \textbf{Description} & & \textbf{Qt'y} &
169     \textbf{Unit} & \textbf{Price} & \textbf{Disc \%} & \textbf{Amount} \\ [0.5em]
170 <%foreach number%>
171   <%runningnumber%> & <%number%> & <%description%> & <%deliverydate%> &
172   <%qty%> & <%unit%> & <%sellprice%> & <%discountrate%> & <%linetotal%> \\
173 <%end number%>
174 \end{tabularx}
175
176
177 \parbox{\textwidth}{
178 \rule{\textwidth}{2pt}
179
180 \vspace{0.2cm}
181
182 \hfill
183 \begin{tabularx}{7cm}{Xr@{}}
184   Subtotal & <%subtotal%> \\
185 <%foreach tax%>
186   <%taxdescription%> on <%taxbase%> & <%tax%> \\
187 <%end tax%>
188 <%if paid%>
189   Paid & - <%paid%> \\
190 <%end paid%>
191   \hline
192 <%if total%>
193   Balance Due & <%total%>
194 <%end total%>
195 \end{tabularx}
196
197 \vspace{0.3cm}
198
199 <%text_amount%> ***** <%decimal%>/100
200 \hfill
201 All prices in \textbf{<%currency%>}.
202
203 \vspace{12pt}
204
205 <%if notes%>
206   <%notes%>
207 <%end if%>
208
209 }
210
211 \vfill
212
213 <%if paid%>
214 \begin{tabularx}{10cm}{@{}lXlr@{}}
215   \textbf{Payments} & & & \\
216   \hline
217   \textbf{Date} & & \textbf{Source} & \textbf{Amount} \\
218 <%end paid%>
219 <%foreach payment%>
220   <%paymentdate%> & <%paymentaccount%> & <%paymentsource%> & <%payment%> \\
221 <%end payment%>
222 <%if paid%>
223 \end{tabularx}
224 <%end paid%>
225
226 \vspace{1cm}
227
228 \centerline{\textbf{Thank You for your valued business!}}
229
230 \rule{\textwidth}{0.5pt}
231
232 \usebox{\ftr}
233
234 \end{document}
235