From 162a742110ede26cbb904b1f38c6a99e4b692eef Mon Sep 17 00:00:00 2001 From: jeff Date: Fri, 29 Feb 2008 17:57:38 +0000 Subject: refactor print_*; invoice sections by package class; could still stand some more refactoring --- conf/invoice_html | 78 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 57 insertions(+), 21 deletions(-) (limited to 'conf/invoice_html') 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 @@ -

CHARGES -

- - - - - - - <%= + <%= + foreach my $section ( @sections ) { + $OUT .= '
RefDescriptionAmount
'; + if ($section->{'description'}) { + $OUT .= + '

'. uc(substr($section->{'description'},0,1)). + ''. uc(substr($section->{'description'},1)). + ''. + '

'; + }else{ + $OUT .= + '

CHARGES'. + '

'; + } + $OUT .= '

'; - foreach my $line ( @detail_items ) { $OUT .= - ''. - ''. $line->{'ref'}. ''. - ''. $line->{'description'}. ''. - ''. $line->{'amount'}. ''. - '' - ; - foreach my $ext_desc ( @{$line->{'ext_description'} } ) { + ''. + ''. + ''. + ''. + ''. + ''; + + foreach my $line ( + grep { ( scalar(@sections) > 1 + ? $section->{'description'} eq $_->{'section'}->{'description'} + : 1 + ) } + @detail_items ) + { $OUT .= - ''. - ''. - ''. - ''. + ''. + ''. + ''. + ''. '' + ; + foreach my $ext_desc ( @{$line->{'ext_description'} } ) { + $OUT .= + ''. + ''. + ''. + ''. + '' + } + } + + + if (scalar(@sections) > 1) { + my $style = 'border-top: 3px solid #000000;'. + 'border-bottom: 3px solid #000000;'; + $OUT .= + ''. + qq(). + qq('. + qq('. + '' + ; } } -- cgit v1.2.1
RefDescriptionAmount
- '. $ext_desc. '
'. $line->{'ref'}. ''. $line->{'description'}. ''. $line->{'amount'}. '
- '. $ext_desc. '
 ). + $section->{'description'}. ' Total ). + $section->{'subtotal'}. '