X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=conf%2Finvoice_html;h=fc553d5d53e81253df6621053398744d2ccd5c66;hp=026bc8b6b6fdea420bbfc630d2c664887eb23ccc;hb=bc03d12fffd22153b5035bc021450387bacc17b8;hpb=4c951501b14bf459fa039db9ef093cfea9e37db3 diff --git a/conf/invoice_html b/conf/invoice_html index 026bc8b6b..fc553d5d5 100644 --- a/conf/invoice_html +++ b/conf/invoice_html @@ -42,7 +42,7 @@   - INVOICE + <%= $notice_name ? substr($notice_name, 0, 1) : 'I' %><%= $notice_name ? uc(substr($notice_name, 1)) : 'NVOICE' %>   @@ -78,6 +78,14 @@ : '' %> + <%= + if($barcode_cid) { + $OUT .= qq!
!; + } + elsif($barcode_img) { + $OUT .= qq!
!; + } + %> Terms: <%= $terms %>
<%= $po_line %> @@ -86,8 +94,11 @@ <%= $summary %> <%= + my $notfirst = 0; + my $columncount = $unitprices ? 5 : 3; foreach my $section ( grep { !$summary || $_->{description} ne $finance_section } @sections ) { if ($section->{'pretotal'} && !$summary) { + $OUT .= '' if $notfirst; $OUT .= '
'. '

'. @@ -95,9 +106,10 @@ ''. uc(substr($section->{'pretotal'},1)). ''. '

'. - '

'; + ''; } unless ($section->{'summarized'}) { + $OUT .= '' if ( $notfirst || $section->{'pretotal'} && !$summary ); $OUT .= ''; + unless ( $section->{description_generator} ) { + $OUT .= '
'; if ($section->{'description'}) { $OUT .= @@ -114,16 +126,23 @@ $OUT .= ''. - ''. - ''. - ''. - ( $unitprices - ? ''. - '' - : '' - ). - ''. - ''; + ''; + + if ($section->{header_generator}) { + my $header = &{$section->{header_generator}}(); + $OUT .= $header; + $columncount = scalar(my @array = split /<\/th>'. + ( $unitprices + ? ''. + '' + : '' + ). + ''; + } + $OUT .= ''; my $lastref = 0; foreach my $line ( @@ -134,57 +153,69 @@ @detail_items ) { $OUT .= - ''. - ''. - ''. - ( $unitprices - ? ''. - '' - : '' - ). - - ''. - '' - ; + ''. + ''. + ''. + ( $unitprices + ? ''. + '' + : '' + ). + + ''; + } + $OUT .= ''; $lastref = $line->{'ref'}; if ( @{$line->{'ext_description'} } ) { - $OUT .= '' : '>'; - $OUT .= '
RefDescriptionUnit PriceQuantityAmount
DescriptionUnit PriceQuantityAmount
'. - ( $line->{'ref'} ne $lastref ? $line->{'ref'} : '' ). ''. $line->{'description'}. ''. $line->{'unit_amount'}. ''. $line->{'quantity'}. ''. $line->{'amount'}. '
'. + ( $line->{'ref'} ne $lastref ? $line->{'ref'} : '' ). ''. $line->{'description'}. ''. $line->{'unit_amount'}. ''. $line->{'quantity'}. ''. $line->{'amount'}. '
'; + unless ( $section->{description_generator} ) { + $OUT .= '{'ext_description'} } ) { $OUT .= ''. + ( $section->{'description_generator'} ? '' : '' ). ''. '' } - $OUT .= '
/i ? '' : 'colspan=99' ). '>'. '  '. $ext_desc. '
'; + } + $OUT .= ''; } } - if (scalar(@sections) > 1) { + if ($section->{'description'} || $multisection) { my $style = 'border-top: 3px solid #000000;'. 'border-bottom: 3px solid #000000;'; $OUT .= ''. - qq( ). - qq(' : '>' ). - $section->{'description'}. ' Total '. - qq(). - $section->{'subtotal'}. ''. - '' - ; + qq( ); + if ($section->{total_generator}) { + $OUT .= &{$section->{total_generator}}($section); + } else { + $OUT .= qq(' : '>' ). + $section->{'description'}. ' Total '. + qq(). + $section->{'subtotal'}. ''; + } + $OUT .= ''; } } if ($section->{'posttotal'}) { - $OUT .= ''; + $OUT .= ''; $OUT .= '

'. $section->{'posttotal'}. ''. @@ -192,6 +223,8 @@ $OUT .= ''; } + $notfirst++; + } my $style = 'border-top: 3px solid #000000;'; @@ -200,18 +233,21 @@ foreach my $line ( @total_items ) { $style .= 'border-bottom: 3px solid #000000;' - if ++$linenum == scalar(@total_items); + if ++$linenum == scalar(@total_items) - ( $balance_due_below_line ? 1 : 0 ); $OUT .= - ''. - qq( ). - qq(' : '>' ). - $line->{'total_item'}. ''. - qq(). - $line->{'total_amount'}. ''. - '' - ; + ''; + if ($section->{total_line_generator}) { + $OUT .= &{$section->{total_line_generator}}($line); + } else { + $OUT .= qq( ). + qq('. + $line->{'total_item'}. ''. + qq(). + $line->{'total_amount'}. ''; + } + $OUT .= ''; $style=''; @@ -221,9 +257,15 @@

-<%= length($summary) ? '' : $notes %> +<%= length($summary) + ? '' + : ( $smallernotes + ? ''.$notes.'' + : $notes + ) +%>


-

<%= $footer %> +

><%= $footer %>