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_summary TH { border-bottom: 2px solid #000000 }
7 .invoice_summary TD { font-size: 10pt; empty-cells: show }
8 .invoice_longtable table { cellspacing: none }
9 .invoice_longtable TH { border-top: 2px solid #000000; border-bottom: 1px solid #000000; padding-left: none; padding-right: none; font-size: 10pt }
10 .invoice_desc TD { border-top: 2px solid #000000; font-weight: bold; font-size: 10pt }
11 .invoice_desc_more TD { font-weight: bold; font-size: 10pt }
12 .invoice_extdesc TD { font-size: 8pt }
13 .invoice_totaldesc TD { font-size: 10pt; empty-cells: show }
14 .allcaps { text-transform:uppercase }
17 <table class="invoice" bgcolor="#ffffff" WIDTH=625 CELLSPACING=8 STYLE="border:1px solid #000000"><tr><td>
19 <table class="invoice_header" width="100%">
21 <td><img src="<%= $cid ? "cid:$cid" : "cust_bill-logo.cgi?quotationnum=$quotationnum;template=$template" %>"></td>
22 <td align="left"><%= $returnaddress %></td>
24 <table CLASS="invoice_headerright" cellspacing=0>
27 <%= emt('Quotation date') %><BR>
33 <%= emt('Quotation #') %><BR>
34 <B><%= $quotationnum %></B>
39 <%= $custnum ? emt('Customer #') : $prospectnum ? emt('Prospect #') : '' %><BR>
40 <B><%= $custnum || $prospectnum %></B>
45 <th colspan=3 align="center" class="allcaps">
46 <FONT SIZE="+3"><%= substr(emt($notice_name),0,1) %></FONT><FONT SIZE="+2"><%= substr(emt($notice_name),1) %></FONT>
58 <b><%= $name %></b><BR>
59 <%= join('<BR>', grep length($_), $company,
62 "$city, $state $zip",
67 <%= $ship_enable ? ('<td align="left">'.
68 join('<BR>',grep length($_), '<b>'.emt('Service Address').'</b>',
72 "$ship_city, $ship_state $ship_zip",
77 '</td><tr><td></td><td></td>'
84 $OUT .= qq! <img src="cid:$barcode_cid"><br> !;
87 $OUT .= qq! <img src="cust_bill-barcode.cgi?invnum=$invnum;template=$template"><br> !;
90 <%= $terms ? emt('Terms') . ": $terms" : '' %><BR>
99 my $columncount = $unitprices ? 5 : 3;
100 foreach my $section ( grep { !$summary || $_->{description} ne $finance_section } @sections ) {
101 if ($section->{'pretotal'} && !$summary) {
102 $OUT .= '</table>' if $notfirst;
104 '<table width="100%"><tr><td>'.
105 '<p align="right"><b><font size="+1">'.
106 uc(substr($section->{'pretotal'},0,1)).
107 '</font><font size="+0">'. uc(substr($section->{'pretotal'},1)).
112 unless ($section->{'summarized'}) {
113 $OUT .= '</table>' if ( $notfirst || $section->{'pretotal'} && !$summary );
114 $OUT .= '<table><tr><td>';
115 my $sectionhead = $section->{'description'} || emt('Charges');
117 '<p class="allcaps"><b><font size="+1">'. substr($sectionhead,0,1).
118 '</font><font size="+0">'. substr($sectionhead,1).
121 '</td></tr></table>';
124 '<table class="invoice_longtable" CELLSPACING=0 WIDTH="100%">'.
127 if ($section->{header_generator}) {
128 my $header = &{$section->{header_generator}}();
130 $columncount = scalar(my @array = split /<\/th><th/i, $header);
132 $OUT .= '<th align="center"></th>'.
133 '<th align="left">' . emt('Description') . '</th>'.
135 ? '<th align="left">' . emt('Unit Price') . '</th>'.
136 '<th align="left">' . emt('Quantity') . '</th>'
138 '<th align="right">' . emt('Amount') . '</th>';
144 grep { ( scalar(@sections) > 1
145 ? $section->{'description'} eq $_->{'section'}->{'description'}
151 '<tr class="invoice_desc';
152 if ( $section->{description_generator} ) {
153 $OUT .= &{$section->{description_generator}}($line);
155 $OUT .= ( ($line->{'ref'} && $line->{'ref'} ne $lastref) ? '' : '_more' ).
157 '<td align="center">'.
158 ( $line->{'ref'} ne $lastref
159 ? $line->{'preref_html'} #. $line->{'ref'}
163 '<td align="left">'. $line->{'description'}. '</td>'.
165 ? '<td align="left">'. $line->{'unit_amount'}. '</td>'.
166 '<td align="left">'. $line->{'quantity'}. '</td>'
170 '<td align="right">'. $line->{'amount'}. '</td>';
173 $lastref = $line->{'ref'};
174 if ( @{$line->{'ext_description'} } ) {
175 unless ( $section->{description_generator} ) {
176 $OUT .= '<tr class="invoice_extdesc"><td></td><td';
177 $OUT .= $unitprices ? ' colspan=3' : '';
178 $OUT .= '><table width="100%">';
180 foreach my $ext_desc ( @{$line->{'ext_description'} } ) {
182 '<tr class="invoice_extdesc">'.
183 ( $section->{'description_generator'} ? '<td></td>' : '' ).
185 ( $ext_desc =~ /<\/?TD>/i ? '' : 'colspan=99' ). '>'.
186 ' '. $ext_desc.
190 unless ( $section->{description_generator} ) {
191 $OUT .= '</table></td><td></td>';
198 if ($section->{'description'} || $multisection and !$section->{no_subtotal}) {
199 my $style = 'border-top: 3px solid #000000;'.
200 'border-bottom: 3px solid #000000;';
202 '<tr class="invoice_totaldesc">'.
203 qq(<td style="$style"> </td>);
204 if ($section->{total_generator}) {
205 $OUT .= &{$section->{total_generator}}($section);
207 $OUT .= qq(<td align="left" style="$style").
208 ( $unitprices ? ' colspan=3>' : '>' ).
209 $section->{'description'}. ' ' . emt('Total') . '</td>'.
210 qq(<td align="right" style="$style">).
211 $section->{'subtotal'}. '</td>';
216 if ($section->{'posttotal'}) {
217 $OUT .= '<tr><td align="right" colspan='. $columncount. '>';
219 '<p><font size="+1">'. $section->{'posttotal'}.
222 $OUT .= '</td></tr>';
229 my $style = 'border-top: 3px solid #000000;';
232 foreach my $line ( @total_items ) {
234 # in the quotation logic, we specifically tag the total line
235 # instead of using "the second one from the bottom"
236 $style .= 'border-bottom: 3px solid #000000;'
237 if $line->{break_after};
240 '<tr class="invoice_totaldesc">';
241 if ($section->{total_line_generator}) {
242 $OUT .= &{$section->{total_line_generator}}($line);
244 $OUT .= qq(<td style="$style"> </td>).
245 qq(<td align="left" style="$style" colspan=").
246 ( $columncount - 2 ). '">'.
247 $line->{'total_item'}. '</td>'.
248 qq(<td align="right" style="$style">).
249 $line->{'total_amount'}. '</td>';
264 ? '<FONT SIZE="-1">'.$notes.'</FONT>'
269 <hr NOSHADE SIZE=2 COLOR="#000000">
270 <p align="center" <%= $smallerfooter ? 'STYLE="font-size:75%;"' : '' %>><%= $footer %>