1 <STYLE TYPE="text/css">
3 font-family: sans-serif;
7 border: 1px solid black;
8 background-color: white;
16 .invoice_headerright TH { border-top: 2px solid #000000; border-bottom: 2px solid #000000 }
17 .invoice_headerright TD { font-size: 10pt; empty-cells: show }
18 .invoice_summary TH { border-bottom: 2px solid #000000 }
19 .invoice_summary TD { font-size: 10pt; empty-cells: show }
20 .invoice_longtable table { cellspacing: none }
21 .invoice_longtable TH { border-top: 2px solid #000000; border-bottom: 1px solid #000000; padding-left: none; padding-right: none; font-size: 10pt }
22 .invoice_desc TD { border-top: 2px solid #000000; font-weight: bold; font-size: 10pt }
23 .invoice_desc_more TD { font-weight: bold; font-size: 10pt }
24 .invoice_extdesc TD { font-size: 8pt }
25 .invoice_totaldesc TD { font-size: 10pt; empty-cells: show }
26 .allcaps { text-transform:uppercase; font-size: 12pt }
32 filter: alpha(opacity=25);
41 vertical-align: middle;
48 <DIV CLASS="watermark-box"><DIV CLASS="watermark-content">
52 <table class="invoice_header" width="100%">
54 <td align="left"><%= $returnaddress %></td>
55 <td align="left"><img src="<%= $cid ? "cid:$cid" : "cust_bill-logo.cgi?invnum=$invnum;template=$template" %>"></td>
57 <table CLASS="invoice_headerright" cellspacing=0>
60 <%= emt('Invoice date') %><BR>
66 <%= emt('Invoice #') %><BR>
72 <%= emt('Customer #') %><BR>
73 <B><%= $custnum %></B>
78 <th colspan=3 align="center" class="allcaps">
79 <FONT SIZE="+3"><%= substr(emt($notice_name),0,1) %></FONT><FONT SIZE="+2"><%= substr(emt($notice_name),1) %></FONT>
88 <table class="invoice_header" width="100%">
93 <b><%= $payname %></b><BR>
94 <%= join('<BR>', grep length($_), $company,
97 "$city, $state $zip",
102 <%= $ship_enable ? ('<td align="left">'.
103 join('<BR>',grep length($_), '<b>'.emt('Service Address').'</b>',
107 "$ship_city, $ship_state $ship_zip",
112 '</td><tr><td></td><td></td>'
119 $OUT .= qq! <img src="cid:$barcode_cid"><br> !;
121 elsif($barcode_img) {
122 $OUT .= qq! <img src="cust_bill-barcode.cgi?invnum=$invnum;template=$template"><br> !;
125 <%= $terms ? emt('Terms') . ': ' . emt($terms) : '' %><BR>
134 my $columncount = $unitprices ? 5 : 3;
135 foreach my $section ( grep { !$summary || $_->{description} ne $finance_section } @sections ) {
136 if ($section->{'pretotal'} && !$summary) {
137 $OUT .= '</table>' if $notfirst++;
139 '<table width="100%"><tr><td>'.
140 '<p align="right"><b><font size="+1">'.
141 uc(substr($section->{'pretotal'},0,1)).
142 '</font><font size="+0">'. uc(substr($section->{'pretotal'},1)).
147 unless ($section->{'summarized'}) {
148 if ( $notfirst || $section->{'pretotal'} && !$summary ) {
152 $OUT .= '<table><tr><td>';
153 $OUT .= '<p class="allcaps"><b>';
155 if ( $section->{'location'} ) {
156 $sectionhead .= $section->{'location'}{'label_prefix'}. ': '
157 if length($section->{'location'}{'label_prefix'});
158 $sectionhead = $section->{'location'}{'address1'};
159 $sectionhead .= ', '.$section->{'location'}{'address2'}
160 if length($section->{'location'}{'address2'});
161 $sectionhead .= ', ' .
162 $section->{'location'}{'city'} . ', ' .
163 $section->{'location'}{'state'} . ' ' .
164 $section->{'location'}{'zip'};
165 $OUT .= $sectionhead;
167 $sectionhead = $section->{'description'} || emt('Charges');
168 $OUT .= '<font size="+1">'. substr($sectionhead,0,1).
169 '</font><font size="+0">'. substr($sectionhead,1).
173 $OUT .= '</b></p></td></tr></table>';
176 '<table class="invoice_longtable" CELLSPACING=0 WIDTH="100%">'.
179 if ($section->{header_generator}) {
180 my $header = &{$section->{header_generator}}();
182 $columncount = scalar(my @array = split /<\/th><th/i, $header);
184 my @headings = ( '', 'Description', 'Amount' );
185 my @aligns = ( 'center', 'left', 'right' );
187 splice @headings, 2, 0, 'Unit Price', 'Quantity';
188 splice @aligns, 2, 0, 'right', 'right';
190 if ( $section->{usage_section} ) {
191 @headings = ( '', 'Description', 'Calls', 'Duration', 'Amount' );
192 @aligns = ( '', 'left', 'right', 'right', 'right' );
196 while ( @headings ) {
197 my $heading = shift @headings;
198 $heading = emt($heading) if $heading;
199 my $align = shift @aligns;
201 <th align="' . $align . '">' . $heading . '</th>';
209 grep { ( scalar(@sections) > 1
210 ? $section->{'description'} eq $_->{'section'}->{'description'}
215 if ( $section->{description_generator} ) {
216 $OUT .= '<tr class="invoice_desc' .
217 &{$section->{description_generator}}($line);
218 } elsif ( $section->{usage_section} ) {
219 my $minutes = sprintf('%d', $line->{'duration'} / 60);
220 my $seconds = $line->{'duration'} % 60;
222 <tr class="invoice_desc_more">
224 <td align="left">' . $line->{'description'} . '</td>
225 <td align="right">' . $line->{'quantity'} . '</td>
226 <td align="right">' . $minutes . 'm ' . $seconds . 's' . '</td>
227 <td align="right">' . $line->{'amount'} . '</td>
230 my $class = 'invoice_desc_more';
231 if ( ($line->{'ref'} || 0) ne $lastref ) {
232 # then it's a new package (not a continuation)
233 $class = 'invoice_desc';
235 $OUT .= '<tr class="'.$class.'">
236 <td align="center">';
238 <td align="left">'. $line->{'description'}. '</td>';
241 '<td align="right">'. $line->{'unit_amount'}. '</td>'.
242 '<td align="right">'. $line->{'quantity'}. '</td>';
244 $OUT .= '<td align="right">'. $line->{'amount'}. '</td>';
247 $lastref = $line->{'ref'} || 0;
248 if ( @{$line->{'ext_description'} } ) {
249 unless ( $section->{description_generator} ) {
250 $OUT .= '<tr class="invoice_extdesc"><td></td><td';
251 $OUT .= $unitprices ? ' colspan=3' : '';
252 $OUT .= '><table width="100%">';
254 foreach my $ext_desc ( @{$line->{'ext_description'} } ) {
256 '<tr class="invoice_extdesc">'.
257 ( $section->{'description_generator'} ? '<td></td>' : '' ).
259 ( $ext_desc =~ /<\/?TD>/i ? '' : 'colspan=99' ). '>'.
260 ' '. $ext_desc.
264 unless ( $section->{description_generator} ) {
265 $OUT .= '</table></td><td></td>';
272 if ($section->{'description'} || $multisection and !$section->{no_subtotal}) {
273 my $style = 'border-top: 3px solid #000000;'.
274 'border-bottom: 3px solid #000000;';
276 '<tr class="invoice_totaldesc">'.
277 qq(<td style="$style"> </td>);
278 if ($section->{total_generator}) {
279 $OUT .= &{$section->{total_generator}}($section);
281 $OUT .= qq(<td align="left" style="$style").
282 ( $unitprices ? ' colspan=3>' : '>' ).
283 $section->{'description'}. ' ' . emt('Total') . '</td>'.
284 qq(<td align="right" style="$style">).
285 $section->{'subtotal'}. '</td>';
289 } # if !$section->{summarized}
290 if ($section->{'posttotal'}) {
291 $OUT .= '<tr><td align="right" colspan='. $columncount. '>';
293 '<p><font size="+1">'. $section->{'posttotal'}.
296 $OUT .= '</td></tr>';
300 my $style = 'border-top: 3px solid #000000;';
303 foreach my $line ( @total_items ) {
305 $style .= 'border-bottom: 3px solid #000000;'
306 if ++$linenum == scalar(@total_items) - ( $balance_due_below_line ? 1 : 0 );
309 '<tr class="invoice_totaldesc">';
310 if ($section->{total_line_generator}) {
311 $OUT .= &{$section->{total_line_generator}}($line);
313 $OUT .= qq(<td style="$style"> </td>).
314 qq(<td align="left" style="$style" colspan=").
315 ( $columncount - 2 ). '">'.
316 $line->{'total_item'}. '</td>'.
317 qq(<td align="right" style="$style">).
318 $line->{'total_amount'}. '</td>';
332 my @location_summary_sections =
337 && $_->{description} ne $finance_section
340 if ( $multisection eq 'location' && scalar(@location_summary_sections) > 1 ) {
348 <b>'.emt('Summary Of New Charges By Location').'</b>
354 <table class="invoice_longtable" cellspacing="0" width="100%">
358 <th align="left">'.emt('Location').'</th>
359 <th align="right">'.emt('Amount').'</th>
365 for my $section (@location_summary_sections) {
366 next unless $section->{description};
368 <tr class="invoice_desc_more">
370 <td>'.$section->{description}.'</td>
371 <td align="right">'. $section->{subtotal} .'</td>
377 <tr class="invoice_desc"><td> </td><td> </td><td> </td></tr>
388 ? '<FONT SIZE="-1">'.$notes.'</FONT>'
393 <hr NOSHADE SIZE=2 COLOR="#000000">
394 <p align="center" <%= $smallerfooter ? 'STYLE="font-size:75%;"' : '' %>><%= $footer %>