diff options
author | jeff <jeff> | 2009-11-20 17:33:40 +0000 |
---|---|---|
committer | jeff <jeff> | 2009-11-20 17:33:40 +0000 |
commit | 62bfeae993beb7f98d50d319360f1fece128982b (patch) | |
tree | 6c97d81c0983b672dfeb15aeaf00f8be58cf4dec /conf | |
parent | 457cf05ffc31212de613249c95a8ab05aed34f47 (diff) |
invoice formatting: add sections for usage, add sections per svc_phone, add folding like line items into one #6592
Diffstat (limited to 'conf')
-rw-r--r-- | conf/invoice_html | 96 |
1 files changed, 55 insertions, 41 deletions
diff --git a/conf/invoice_html b/conf/invoice_html index b7f7b9789..df4674b6a 100644 --- a/conf/invoice_html +++ b/conf/invoice_html @@ -114,15 +114,20 @@ $OUT .= '<table class="invoice_longtable" CELLSPACING=0 WIDTH="100%">'. - '<tr>'. - '<th align="center">Ref</th>'. - '<th align="left">Description</th>'. - ( $unitprices - ? '<th align="left">Unit Price</th>'. - '<th align="left">Quantity</th>' - : '' - ). - '<th align="right">Amount</th>'. + '<tr>'; + + if ($section->{header_generator}) { + $OUT .= &{$section->{header_generator}}(); + } else { + $OUT .= '<th align="center">Ref</th>'. + '<th align="left">Description</th>'. + ( $unitprices + ? '<th align="left">Unit Price</th>'. + '<th align="left">Quantity</th>' + : '' + ). + '<th align="right">Amount</th>'; + } '</tr>'; my $lastref = 0; @@ -134,21 +139,24 @@ @detail_items ) { $OUT .= - '<tr class="invoice_desc'. - ( ($line->{'ref'} && $line->{'ref'} ne $lastref) ? '' : '_more' ). - '">'. - '<td align="center">'. - ( $line->{'ref'} ne $lastref ? $line->{'ref'} : '' ). '</td>'. - '<td align="left">'. $line->{'description'}. '</td>'. - ( $unitprices - ? '<td align="left">'. $line->{'unit_amount'}. '</td>'. - '<td align="left">'. $line->{'quantity'}. '</td>' - : '' - ). - - '<td align="right">'. $line->{'amount'}. '</td>'. - '</tr>' - ; + '<tr class="invoice_desc'; + if ( $section->{description_generator} ) { + $OUT .= &{$section->{description_generator}}($line); + } else { + $OUT .= ( ($line->{'ref'} && $line->{'ref'} ne $lastref) ? '' : '_more' ). + '">'. + '<td align="center">'. + ( $line->{'ref'} ne $lastref ? $line->{'ref'} : '' ). '</td>'. + '<td align="left">'. $line->{'description'}. '</td>'. + ( $unitprices + ? '<td align="left">'. $line->{'unit_amount'}. '</td>'. + '<td align="left">'. $line->{'quantity'}. '</td>' + : '' + ). + + '<td align="right">'. $line->{'amount'}. '</td>'; + } + $OUT .= '</tr>'; $lastref = $line->{'ref'}; if ( @{$line->{'ext_description'} } ) { $OUT .= '<tr class="invoice_extdesc"><td></td><td'; @@ -173,14 +181,17 @@ 'border-bottom: 3px solid #000000;'; $OUT .= '<tr class="invoice_totaldesc">'. - qq(<td style="$style"> </td>). - qq(<td align="left" style="$style"). - ( $unitprices ? ' colspan=3>' : '>' ). - $section->{'description'}. ' Total </td>'. - qq(<td align="right" style="$style">). - $section->{'subtotal'}. '</td>'. - '</tr>' - ; + qq(<td style="$style"> </td>); + if ($section->{total_generator}) { + $OUT .= &{$section->{total_generator}}($section); + } else { + $OUT .= qq(<td align="left" style="$style"). + ( $unitprices ? ' colspan=3>' : '>' ). + $section->{'description'}. ' Total </td>'. + qq(<td align="right" style="$style">). + $section->{'subtotal'}. '</td>'; + } + $OUT .= '</tr>'; } } if ($section->{'posttotal'}) { @@ -203,15 +214,18 @@ if ++$linenum == scalar(@total_items); $OUT .= - '<tr class="invoice_totaldesc">'. - qq(<td style="$style"> </td>). - qq(<td align="left" style="$style"). - ( $unitprices ? ' colspan=3>' : '>' ). - $line->{'total_item'}. '</td>'. - qq(<td align="right" style="$style">). - $line->{'total_amount'}. '</td>'. - '</tr>' - ; + '<tr class="invoice_totaldesc">'; + if ($section->{total_line_generator}) { + $OUT .= &{$section->{total_line_generator}}($line); + } else { + $OUT .= qq(<td style="$style"> </td>). + qq(<td align="left" style="$style"). + ( $unitprices ? ' colspan=3>' : '>' ). + $line->{'total_item'}. '</td>'. + qq(<td align="right" style="$style">). + $line->{'total_amount'}. '</td>'; + } + $OUT .= '</tr>'; $style=''; |