dash removal
[freeside.git] / conf / invoice_html
1 <STYLE TYPE="text/css">
2 .invoice { font-family: sans-serif; font-size: 10pt }
3 .invoice_header { font-size: 10pt }
4 .invoice_headerright TH { border-top: 2px solid #000000; border-bottom: 2px solid #000000 }
5 .invoice_headerright TD { font-size: 10pt; empty-cells: show }
6 .invoice_longtable table { cellspacing: none }
7 .invoice_longtable TH { border-top: 2px solid #000000; border-bottom: 1px solid #000000; padding-left: none; padding-right: none; font-size: 10pt }
8 .invoice_desc TD { border-top: 2px solid #000000; font-weight: bold; font-size: 10pt }
9 .invoice_extdesc TD { font-size: 8pt }
10 .invoice_totaldesc TD { font-size: 10pt; empty-cells: show }
11 </STYLE>
12
13 <table class="invoice" bgcolor="#ffffff" WIDTH=768 CELLSPACING=8><tr><td>
14
15   <table class="invoice_header" width="100%">
16     <tr>
17      <td><img src="<%= $cid ? "cid:$cid" : "cust_bill-logo.cgi?$template" %>"></td>
18      <td align="left"><%= $returnaddress %></td>
19       <td align="right">
20         <table CLASS="invoice_headerright" cellspacing=0>
21           <tr>
22             <td align="right">
23               Invoice&nbsp;date<BR>
24               <B><%= $date %></B>
25             </td>
26             <td>
27             </td>
28             <td align="center">
29               Invoice&nbsp;#<BR>
30               <B><%= $invnum %></B>
31             </td>
32             <td>
33             </td>
34             <td align="center">
35               Customer #<BR>
36               <B><%= $custnum %></B>
37             </td>
38           </tr>
39           <tr>
40             <th>&nbsp;</th>
41             <th colspan=3 align="center">
42               <FONT SIZE="+3">I</FONT><FONT SIZE="+2">NVOICE</FONT>
43             </th>
44             <th>&nbsp;</th>
45           </tr>
46         </table>
47       </td>
48     </tr>
49
50     <tr>
51       <td>
52       </td>
53       <td align="left">
54         <b><%= $payname %></b><BR>
55         <%= join('<BR>', grep length($_), $company,
56                                           $address1,
57                                           $address2,
58                                           "$city,&nbsp;$state&nbsp;&nbsp;$zip",
59                                           $country,
60                 )
61         %>
62       </td>
63       <td align="right">
64         Terms: <%= $terms %><BR>
65         <%= $po_line %>
66       </td>
67     </tr>
68
69   </table>
70
71   <%=
72       foreach my $section ( @sections ) {
73         if ($section->{'pretotal'}) {
74           $OUT .=
75             '<table width="100%"><tr><td>'.
76             '<p align="right"><b><font size="+1">'.
77             uc(substr($section->{'pretotal'},0,1)).
78             '</font><font size="+0">'. uc(substr($section->{'pretotal'},1)).
79             '</font></b>'.
80             '<p>'.
81             '</td></tr></table>';
82         }
83         $OUT .= '<table><tr><td>';
84         if ($section->{'description'}) {
85           $OUT .=
86             '<p><b><font size="+1">'. uc(substr($section->{'description'},0,1)).
87             '</font><font size="+0">'. uc(substr($section->{'description'},1)).
88             '</font></b>'.
89             '<p>';
90         }else{
91           $OUT .=
92             '<p><b><font size="+1">C</font><font size="+0">HARGES</font></b>'.
93             '<p>';
94         }
95         $OUT .= '</td></tr></table>';
96
97         $OUT .=
98           '<table class="invoice_longtable" CELLSPACING=0 WIDTH="100%">'.
99           '<tr>'.
100             '<th align="center">Ref</th>'.
101             '<th align="left">Description</th>'.
102             ( $unitprices 
103                 ? '<th align="left">Unit Price</th>'.
104                   '<th align="left">Quantity</th>'
105                 : ''
106               ).
107             '<th align="right">Amount</th>'.
108           '</tr>';
109
110         foreach my $line (
111           grep { ( scalar(@sections) > 1 
112                  ? $section->{'description'} eq $_->{'section'}->{'description'}
113                  : 1
114                ) }
115           @detail_items )
116         {
117           $OUT .=
118             '<tr class="invoice_desc">'.
119               '<td align="center">'. $line->{'ref'}. '</td>'.
120               '<td align="left">'. $line->{'description'}. '</td>'.
121               ( $unitprices 
122                   ? '<td align="left">'. $line->{'unit_amount'}. '</td>'.
123                     '<td align="left">'. $line->{'quantity'}. '</td>'
124                   : ''
125               ).
126
127               '<td align="right">'. $line->{'amount'}. '</td>'.
128             '</tr>'
129           ;
130           if ( @{$line->{'ext_description'} } ) {
131             $OUT .= '<tr class="invoice_extdesc"><td></td><td';
132             $OUT .= $unitprices ? ' colspan=3>' : '>';
133             $OUT .= '<table width="100%">';
134             foreach my $ext_desc ( @{$line->{'ext_description'} } ) {
135               $OUT .=
136                 '<tr class="invoice_extdesc">'.
137                   '<td align="left">&nbsp;&nbsp;'. $ext_desc. '</td>'.
138                 '</tr>'
139             }
140             $OUT .= '</table></td><td></td></tr>';
141           }
142         }
143
144
145         if (scalar(@sections) > 1) {
146           my $style = 'border-top: 3px solid #000000;'.
147                       'border-bottom: 3px solid #000000;';
148           $OUT .=
149             '<tr class="invoice_totaldesc">'.
150               qq(<td style="$style">&nbsp;</td>).
151               qq(<td align="left" style="$style"> colspan=3).
152                 $section->{'description'}. ' Total </td>'.
153               qq(<td align="right" style="$style">).
154                 $section->{'subtotal'}. '</td>'.
155             '</tr>'
156         ;
157         }
158
159         if ($section->{'posttotal'}) {
160           $OUT .= '<tr><td align="right" colspan=5>';
161           $OUT .=
162             '<p><font size="+1">'. $section->{'posttotal'}.
163             '</font>'.
164             '<p>';
165           $OUT .= '</td></tr>';
166         }
167
168       }
169
170       my $style = 'border-top: 3px solid #000000;';
171       my $linenum = 0;
172
173       foreach my $line ( @total_items ) {
174
175         $style .= 'border-bottom: 3px solid #000000;'
176           if ++$linenum == scalar(@total_items);
177
178         $OUT .=
179           '<tr class="invoice_totaldesc">'.
180             qq(<td style="$style">&nbsp;</td>).
181             qq(<td align="left" style="$style").
182             ( $unitprices ? ' colspan=3>' : '>' ).
183               $line->{'total_item'}. '</td>'.
184             qq(<td align="right" style="$style">).
185               $line->{'total_amount'}. '</td>'.
186           '</tr>'
187         ;
188
189         $style='';
190
191       }
192
193     %>
194   </table>
195   <br><br>
196
197 <%= $notes %>
198
199   <hr NOSHADE SIZE=2 COLOR="#000000">
200   <p align="center"><%= $footer %>
201
202 </td></tr></table>