diff options
author | jeff <jeff> | 2008-02-29 17:57:38 +0000 |
---|---|---|
committer | jeff <jeff> | 2008-02-29 17:57:38 +0000 |
commit | 162a742110ede26cbb904b1f38c6a99e4b692eef (patch) | |
tree | 406b9f557c3f38dcd1d1ec611f53d4efe135f14c /conf/invoice_html | |
parent | 9e6c6f13593dd5137ea920f49d36dc4321c9e99c (diff) |
refactor print_*; invoice sections by package class; could still stand some more refactoring
Diffstat (limited to 'conf/invoice_html')
-rw-r--r-- | conf/invoice_html | 78 |
1 files changed, 57 insertions, 21 deletions
diff --git a/conf/invoice_html b/conf/invoice_html index b13b08f46..9d97243e4 100644 --- a/conf/invoice_html +++ b/conf/invoice_html @@ -68,31 +68,67 @@ </table> - <p><b><font size="+1">C</font><font size="+0">HARGES</font></b> - <p> - <table class="invoice_longtable" CELLSPACING=0 WIDTH="100%"> - <tr> - <th align="center">Ref</th> - <th align="left">Description</th> - <th align="right">Amount</th> - </tr> - <%= + <%= + foreach my $section ( @sections ) { + $OUT .= '<table><tr><td>'; + if ($section->{'description'}) { + $OUT .= + '<p><b><font size="+1">'. uc(substr($section->{'description'},0,1)). + '</font><font size="+0">'. uc(substr($section->{'description'},1)). + '</font></b>'. + '<p>'; + }else{ + $OUT .= + '<p><b><font size="+1">C</font><font size="+0">HARGES</font></b>'. + '<p>'; + } + $OUT .= '</td></tr></table>'; - foreach my $line ( @detail_items ) { $OUT .= - '<tr class="invoice_desc">'. - '<td align="center">'. $line->{'ref'}. '</td>'. - '<td align="left">'. $line->{'description'}. '</td>'. - '<td align="right">'. $line->{'amount'}. '</td>'. - '</tr>' - ; - foreach my $ext_desc ( @{$line->{'ext_description'} } ) { + '<table class="invoice_longtable" CELLSPACING=0 WIDTH="100%">'. + '<tr>'. + '<th align="center">Ref</th>'. + '<th align="left">Description</th>'. + '<th align="right">Amount</th>'. + '</tr>'; + + foreach my $line ( + grep { ( scalar(@sections) > 1 + ? $section->{'description'} eq $_->{'section'}->{'description'} + : 1 + ) } + @detail_items ) + { $OUT .= - '<tr class="invoice_extdesc">'. - '<td></td>'. - '<td align="left">- '. $ext_desc. '</td>'. - '<td></td>'. + '<tr class="invoice_desc">'. + '<td align="center">'. $line->{'ref'}. '</td>'. + '<td align="left">'. $line->{'description'}. '</td>'. + '<td align="right">'. $line->{'amount'}. '</td>'. '</tr>' + ; + foreach my $ext_desc ( @{$line->{'ext_description'} } ) { + $OUT .= + '<tr class="invoice_extdesc">'. + '<td></td>'. + '<td align="left">- '. $ext_desc. '</td>'. + '<td></td>'. + '</tr>' + } + } + + + if (scalar(@sections) > 1) { + my $style = 'border-top: 3px solid #000000;'. + 'border-bottom: 3px solid #000000;'; + $OUT .= + '<tr class="invoice_totaldesc">'. + qq(<td style="$style"> </td>). + qq(<td align="left" style="$style">). + $section->{'description'}. ' Total </td>'. + qq(<td align="right" style="$style">). + $section->{'subtotal'}. '</td>'. + '</tr>' + ; } } |