summaryrefslogtreecommitdiff
path: root/conf/invoice_latex
blob: 195f8fbb2dae17e677c05a6019f03bdc453a17d2 (plain)
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
%% file: Standard Multipage.tex
%% Purpose: Multipage bill template for e-Bills
%% 
%% Created by Mark Asplen-Taylor
%% Asplen Management Ltd
%% www.asplen.co.uk
%%
%% Modified for Freeside by Ivan Kohler
%%
%% Changes
%% 	0.1	4/12/00	Created
%%	0.2	18/10/01	More fields added
%%	1.0	16/11/01	RELEASED
%%	1.2	16/10/02	Invoice number added
%%	1.3	2/12/02	Logo graphic added
%%	1.4	7/2/03	Multipage headers/footers added
%%      n/a     10/12/03 forked for Freeside; checked into CVS
%%

\documentclass[letterpaper]{article}

\usepackage{fancyhdr,lastpage,ifthen,longtable,afterpage}
\usepackage{graphicx}			% required for logo graphic

\addtolength{\voffset}{-0.0in}	% top margin to top of header
\addtolength{\hoffset}{-0.60in}	%left margin on page
\addtolength{\topmargin}{-0.6in}	% top margin to top of header
\setlength{\headheight}{1in} 		% height of header
\setlength{\headsep}{0.5in}    	% between header and text
\addtolength{\textheight}{-0.4in} 	% height of main text

\addtolength{\textheight}{-0.5in} 	% height of main text
\setlength{\footskip}{0.5in}		% bottom of footer from bottom of text

\addtolength{\textwidth}{2.1in}    	% width of text
\setlength{\oddsidemargin}{0in} 	% odd page left margin
\setlength{\evensidemargin}{0in} 	% even page left margin

\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{1pt}

						% New command for address lines i.e. skip them if blank

\newcommand{\addressline}[1]{\ifthenelse{\equal{#1}{}}{}{#1\newline}}
\newcommand{\dollar}[1][]{\symbol{36}} % Inserts dollar symbol

\pagestyle{fancy}

%% Font options are:
%%	bch	Bitsream Charter
%% 	put	Utopia
%%	phv	Adobe Helvetica
%%	pnc	New Century Schoolbook
%%	ptm	Times
%%	pcr	Courier

\renewcommand{\familydefault}{phv}		

\begin{document}
%
%%	Headers and footers defined for the first page
\fancyfoot[CO,CE]{\small{
\begin{tabular}{c}
$footer
\end{tabular}}}
%
%%	The LH Heading comprising logo
%%	UNCOMMENT the following FOUR lines and change the path if necssary to provide a logo
\fancyhead[LO,LE]{
\begin{tabular}{l}
\includegraphics{/usr/local/etc/freeside/conf.DBI:Pg:dbname=freeside/logo.eps}
\end{tabular}}
%
%%	The Heading comprising isue date, customer ref & INVOICE name
\fancyhead[RO,RE]{
\begin{tabular}{rcl}
Invoice date & & Invoice number \\
\vspace{0.2cm}
\textbf{$date} & & \textbf{$invnum} \\\hline
\rule{0pt}{5ex} &~~ \huge{\textsc{Invoice}}& \\
\vspace{-0.2cm}
 & & \\\hline
\end{tabular}}
%
%%	Header & footer changes for subsequent pages
%
\afterpage{ \fancyfoot[RO,RE]{\small{\thepage\ of \pageref{LastPage}}} }
\afterpage{ \fancyfoot[CO,CE]{\small{$smallfooter}} }
\afterpage{ \fancyhead[LO,LE]{\small{}} }
\afterpage{ \fancyhead[RO,RE]{\small{
\begin{tabular}{ll}
Invoice date & Invoice number\\
\textbf{$date} & \textbf{$invnum}\\
\end{tabular}}} }
%
%
\makebox{
\begin{minipage}[t]{2.9in}
\vspace{0.20in}
\textbf{$payname}\\
\addressline{$company}
\addressline{$address1}
\addressline{$address2}
\addressline{$city, $state  $zip}
\addressline{$country}
\end{minipage}}
\hfill
\makebox{
\begin{minipage}[t]{2.5in}
\begin{flushright}
Terms: $terms\\
$po_line\\
\end{flushright}
\end{minipage}}
\vspace{0.5cm}
%
\section*{\textsc{Charges}}
\begin{longtable}{|c|l|c|r|r|}
\hline
\rule{0pt}{2.5ex}
\makebox[1.4cm]{\textbf{Ref}} & 
\makebox[7.9cm][l]{\textbf{Description}} & 
\makebox[1.3cm][c]{\textbf{Quantity}} & 
\makebox[2.5cm][r]{\textbf{Unit Price}} & 
\makebox[2.5cm][r]{\textbf{Amount}} \\
\hline
\endfirsthead
\multicolumn{5}{r}{\rule{0pt}{2.5ex}Continued from previous page}\\
\hline
\rule{0pt}{2.5ex}
\makebox[1.4cm]{\textbf{Ref}} & 
\makebox[7.9cm][l]{\textbf{Description}} & 
\makebox[1.3cm][c]{\textbf{Quantity}} & 
\makebox[2.5cm][r]{\textbf{Unit Price}} & 
\makebox[2.5cm][r]{\textbf{Amount}} \\
\hline
\endhead
\multicolumn{5}{r}{\rule{0pt}{2.5ex}/cont...}\\
\endfoot
%%TotalDetails
 & \multicolumn{3}{l}{$total_item}    & $total_amount\\
%%EndTotalDetails
\hline
\endlastfoot
%%Detail
\rule{0pt}{2.5ex}$ref & 
\begin{tabular}{l}
$description\tabularnewline
\end{tabular}
& $quantity & \dollar $amount & \dollar $amount\\\hline
%%EndDetail
\end{longtable}
\vfill
$notes
\end{document}