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