summaryrefslogtreecommitdiff
path: root/conf/invoice_latex.diff
blob: b66a522f06794894f2d7d151a53300499db43d90 (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
--- invoice_latex.old	2005-04-14 01:52:02.000000000 -0700
+++ invoice_latex	2005-04-14 02:33:26.000000000 -0700
@@ -5,7 +5,7 @@
 %% Asplen Management Ltd
 %% www.asplen.co.uk
 %%
-%% Modified for Freeside by Ivan Kohler
+%% Modified for Freeside by Ivan Kohler and Kristian Hoffman
 %%
 %% Changes
 %% 	0.1	4/12/00	Created
@@ -61,7 +61,7 @@
 %%	Headers and footers defined for the first page
 \fancyfoot[CO,CE]{\small{
 \begin{tabular}{c}
-$footer
+[@-- $footer --@]
 \end{tabular}}}
 %
 %%	The LH Heading comprising logo
@@ -76,7 +76,7 @@
 \begin{tabular}{rcl}
 Invoice date & & Invoice number \\
 \vspace{0.2cm}
-\textbf{$date} & & \textbf{$invnum} \\\hline
+\textbf{[@-- $date --@]} & & \textbf{[@-- $invnum --@]} \\\hline
 \rule{0pt}{5ex} &~~ \huge{\textsc{Invoice}}& \\
 \vspace{-0.2cm}
  & & \\\hline
@@ -85,71 +85,76 @@
 %%	Header & footer changes for subsequent pages
 %
 \afterpage{ \fancyfoot[RO,RE]{\small{\thepage\ of \pageref{LastPage}}} }
-\afterpage{ \fancyfoot[CO,CE]{\small{$smallfooter}} }
+\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}\\
+\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}
+\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\\
+Terms: [@-- $terms --@]\\
+[@-- $po_line --@]\\
 \end{flushright}
 \end{minipage}}
 \vspace{0.5cm}
 %
 \section*{\textsc{Charges}}
-\begin{longtable}{|c|l|c|r|r|}
+\begin{longtable}{|c|l|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}} \\
+\makebox[13cm][l]{\textbf{Description}} & 
+\makebox[2cm][r]{\textbf{Amount}} \\
 \hline
 \endfirsthead
-\multicolumn{5}{r}{\rule{0pt}{2.5ex}Continued from previous page}\\
+\multicolumn{3}{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}} \\
+\makebox[13cm][l]{\textbf{Description}} & 
+\makebox[2cm][r]{\textbf{Amount}} \\
 \hline
 \endhead
-\multicolumn{5}{r}{\rule{0pt}{2.5ex}/cont...}\\
+\multicolumn{3}{r}{\rule{0pt}{2.5ex}/cont...}\\
 \endfoot
-%%TotalDetails
- & \multicolumn{3}{l}{$total_item}    & $total_amount\\
-%%EndTotalDetails
+[@--
+
+  foreach my $line (@total_items) {
+    $OUT .= ' & \multicolumn{1}{l}{' . $line->{'total_item'} . '} & ' .
+            $line->{'total_amount'} . '\\\\' . "\n";
+  }
+
+--@]
 \hline
 \endlastfoot
-%%Detail
-\rule{0pt}{2.5ex}$ref & 
-\begin{tabular}{l}
-$description\tabularnewline
-\end{tabular}
-& $quantity & \dollar $amount & \dollar $amount\\\hline
-%%EndDetail
+[@--
+
+  foreach my $line (@detail_items) {
+    $OUT .= '\rule{0pt}{2.5ex}' . $line->{'ref'} . ' &' . "\n".
+            '\begin{tabular}{l}' . "\n".
+            $line->{'description'} . '\tabularnewline' . "\n".
+            '\end{tabular}' . "\n".
+            '& \dollar ' . $line->{'amount'} . '\\\\\\hline' . "\n";
+  }
+
+--@]
 \end{longtable}
 \vfill
-$notes
+[@-- $notes --@]
 \end{document}