hopefully fully fix bulk email errors when selecting a single payby
[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=625 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="center">
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       <%= $ship_enable ? ('<td align="left">'.
64                           join('<BR>',grep length($_), '<b>Service Address</b>',
65                                                        $ship_company,
66                                                        $ship_address1,
67                                                        $ship_address2,
68                                                        "$ship_city,&nbsp;$ship_state&nbsp;$ship_zip",
69                                                        $ship_country,
70                                                        ' ',
71                                                        ' ',
72                               ).
73                            '</td><tr><td></td><td></td>'
74                          )
75                        : ''
76       %>
77       <td align="right">
78         Terms: <%= $terms %><BR>
79         <%= $po_line %>
80       </td>
81     </tr>
82
83   </table>
84
85   <p><b><font size="+1">C</font><font size="+0">HARGES</font></b>
86   <p>
87   <table class="invoice_longtable" CELLSPACING=0 WIDTH="100%">
88     <tr>
89       <th align="center">Ref</th>
90       <th align="left">Description</th>
91       <%= ( $unitprices 
92               ? '<th align="left">Unit Price</th>'.
93                 '<th align="left">Quantity</th>'
94               : ''
95             )
96       %>
97       <th align="right">Amount</th>
98     </tr>
99     <%=
100
101       foreach my $line ( @detail_items ) {
102         $OUT .=
103           '<tr class="invoice_desc">'.
104             '<td align="center">'. $line->{'ref'}. '</td>'.
105             '<td align="left">'. $line->{'description'}. '</td>'.
106             ( $unitprices 
107                 ? '<td align="left">'. $line->{'unit_amount'}. '</td>'.
108                   '<td align="left">'. $line->{'quantity'}. '</td>'
109                 : ''
110             ).
111             '<td align="right">'. $line->{'amount'}. '</td>'.
112           '</tr>'
113         ;
114         if ( @{$line->{'ext_description'} } ) {
115           $OUT .= '<tr class="invoice_extdesc"><td></td><td';
116           $OUT .= $unitprices ? ' colspan=3>' : '>';
117           $OUT .= '<table width="100%">';
118           foreach my $ext_desc ( @{$line->{'ext_description'} } ) {
119             $OUT .=
120               '<tr class="invoice_extdesc">'.
121                 '<td align="left">&nbsp;&nbsp;'. $ext_desc. '</td>'.
122               '</tr>'
123           }
124           $OUT .= '</table></td><td></td></tr>';
125         }
126       }
127
128       my $style = 'border-top: 3px solid #000000;';
129       my $linenum = 0;
130
131       foreach my $line ( @total_items ) {
132
133         $style .= 'border-bottom: 3px solid #000000;'
134           if ++$linenum == scalar(@total_items);
135
136         $OUT .=
137           '<tr class="invoice_totaldesc">'.
138             qq(<td style="$style">&nbsp;</td>).
139             qq(<td align="left" style="$style").
140             ( $unitprices ? ' colspan=3>' : '>' ).
141               $line->{'total_item'}. '</td>'.
142             qq(<td align="right" style="$style">).
143               $line->{'total_amount'}. '</td>'.
144           '</tr>'
145         ;
146
147         $style='';
148
149       }
150
151     %>
152   </table>
153   <br><br>
154
155 <%= $notes %>
156
157   <hr NOSHADE SIZE=2 COLOR="#000000">
158   <p align="center"><%= $footer %>
159
160 </td></tr></table>