1 %% file: Standard Multipage.tex
\r
2 %% Purpose: Multipage bill template for e-Bills
\r
4 %% Created by Mark Asplen-Taylor
\r
5 %% Asplen Management Ltd
\r
8 %% Modified for Freeside by Ivan Kohler and Kristian Hoffman
\r
11 %% 0.1 4/12/00 Created
\r
12 %% 0.2 18/10/01 More fields added
\r
13 %% 1.0 16/11/01 RELEASED
\r
14 %% 1.2 16/10/02 Invoice number added
\r
15 %% 1.3 2/12/02 Logo graphic added
\r
16 %% 1.4 7/2/03 Multipage headers/footers added
\r
17 %% n/a 10/12/03 forked for Freeside; checked into CVS
\r
20 \documentclass[letterpaper]{article}
\r
22 \usepackage{fancyhdr,lastpage,ifthen,longtable,afterpage}
\r
23 \usepackage{graphicx} % required for logo graphic
\r
25 \addtolength{\voffset}{-0.0in} % top margin to top of header
\r
26 \addtolength{\hoffset}{-0.60in} %left margin on page
\r
27 \addtolength{\topmargin}{-0.6in} % top margin to top of header
\r
28 \setlength{\headheight}{1in} % height of header
\r
29 \setlength{\headsep}{0.5in} % between header and text
\r
30 \addtolength{\textheight}{-0.4in} % height of main text
\r
32 \addtolength{\textheight}{-0.5in} % height of main text
\r
33 \setlength{\footskip}{0.5in} % bottom of footer from bottom of text
\r
35 \addtolength{\textwidth}{2.1in} % width of text
\r
36 \setlength{\oddsidemargin}{0in} % odd page left margin
\r
37 \setlength{\evensidemargin}{0in} % even page left margin
\r
39 \renewcommand{\headrulewidth}{0pt}
\r
40 \renewcommand{\footrulewidth}{1pt}
\r
42 % New command for address lines i.e. skip them if blank
\r
44 \newcommand{\addressline}[1]{\ifthenelse{\equal{#1}{}}{}{#1\newline}}
\r
45 \newcommand{\dollar}[1][]{\symbol{36}} % Inserts dollar symbol
\r
49 %% Font options are:
\r
50 %% bch Bitsream Charter
\r
52 %% phv Adobe Helvetica
\r
53 %% pnc New Century Schoolbook
\r
57 \renewcommand{\familydefault}{phv}
\r
61 %% Headers and footers defined for the first page
\r
62 \fancyfoot[CO,CE]{\small{
\r
67 %% The LH Heading comprising logo
\r
68 %% UNCOMMENT the following FOUR lines and change the path if necssary to provide a logo
\r
71 \includegraphics{/usr/local/etc/freeside/conf.DBI:Pg:dbname=freeside/logo.eps}
\r
74 %% The Heading comprising isue date, customer ref & INVOICE name
\r
76 \begin{tabular}{rcl}
\r
77 Invoice date & & Invoice number \\
\r
79 \textbf{[@-- $date --@]} & & \textbf{[@-- $invnum --@]} \\\hline
\r
80 \rule{0pt}{5ex} &~~ \huge{\textsc{Invoice}}& \\
\r
85 %% Header & footer changes for subsequent pages
\r
87 \afterpage{ \fancyfoot[RO,RE]{\small{\thepage\ of \pageref{LastPage}}} }
\r
88 \afterpage{ \fancyfoot[CO,CE]{\small{[@-- $smallfooter --@]}} }
\r
89 \afterpage{ \fancyhead[LO,LE]{\small{}} }
\r
90 \afterpage{ \fancyhead[RO,RE]{\small{
\r
92 Invoice date & Invoice number\\
\r
93 \textbf{[@-- $date --@]} & \textbf{[@-- $invnum --@]}\\
\r
98 \begin{minipage}[t]{2.9in}
\r
100 \textbf{[@-- $payname --@]}\\
\r
101 \addressline{[@-- $company --@]}
\r
102 \addressline{[@-- $address1 --@]}
\r
103 \addressline{[@-- $address2 --@]}
\r
104 \addressline{[@-- $city --@], [@-- $state --@] [@-- $zip --@]}
\r
105 \addressline{[@-- $country --@]}
\r
109 \begin{minipage}[t]{2.5in}
\r
111 Terms: [@-- $terms --@]\\
\r
112 [@-- $po_line --@]\\
\r
117 \section*{\textsc{Charges}}
\r
118 \begin{longtable}{|c|l|r|}
\r
121 \makebox[1.4cm]{\textbf{Ref}} &
\r
122 \makebox[13cm][l]{\textbf{Description}} &
\r
123 \makebox[2cm][r]{\textbf{Amount}} \\
\r
126 \multicolumn{3}{r}{\rule{0pt}{2.5ex}Continued from previous page}\\
\r
129 \makebox[1.4cm]{\textbf{Ref}} &
\r
130 \makebox[13cm][l]{\textbf{Description}} &
\r
131 \makebox[2cm][r]{\textbf{Amount}} \\
\r
134 \multicolumn{3}{r}{\rule{0pt}{2.5ex}/cont...}\\
\r
138 foreach my $line (@total_items) {
\r
139 $OUT .= ' & \multicolumn{1}{l}{' . $line->{'total_item'} . '} & ' .
\r
140 $line->{'total_amount'} . '\\\\' . "\n";
\r
148 foreach my $line (@detail_items) {
\r
149 $OUT .= '\rule{0pt}{2.5ex}' . $line->{'ref'} . ' &' . "\n".
\r
150 '\begin{tabular}{l}' . "\n".
\r
151 $line->{'description'} . '\tabularnewline' . "\n".
\r
152 '\end{tabular}' . "\n".
\r
153 '& \dollar ' . $line->{'amount'} . '\\\\\\hline' . "\n";
\r