summaryrefslogtreecommitdiff
path: root/conf/invoice_html
diff options
context:
space:
mode:
Diffstat (limited to 'conf/invoice_html')
-rw-r--r--conf/invoice_html96
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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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='';