X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=conf%2Finvoice_html;h=dfd87c79b9c645c4a3014f30eefa82ad16c06f04;hp=98a1760588217d2ec9a172bee84cae62ead1e1cf;hb=4ff12dc7e14232390daca2f14a278cde46a8e573;hpb=5c6cf04c160cfc19c964399a5d5791033f4115cf diff --git a/conf/invoice_html b/conf/invoice_html index 98a176058..dfd87c79b 100644 --- a/conf/invoice_html +++ b/conf/invoice_html @@ -1,45 +1,82 @@ -
+
+ +
+ <%= $watermark %> +
- +
">"> <%= $returnaddress %> - - @@ -60,17 +97,42 @@ ) %> + <%= $ship_enable ? ('' + ) + : '' + %>
- Invoice date
+
+ <%= emt('Invoice date') %>
<%= $date %>
- Invoice #
+ <%= emt('Invoice #') %>
<%= $invnum %>
- Customer #
+ <%= emt('Customer #') %>
<%= $custnum %>
  - INVOICE + + <%= substr(emt($notice_name),0,1) %><%= substr(emt($notice_name),1) %>  
'. + join('
',grep length($_), ''.emt('Service Address').'', + $ship_company, + $ship_address1, + $ship_address2, + "$ship_city, $ship_state $ship_zip", + $ship_country, + ' ', + ' ', + ). + '
- Terms: <%= $terms %>
+ <%= + if($barcode_cid) { + $OUT .= qq!
!; + } + elsif($barcode_img) { + $OUT .= qq!
!; + } + %> + <%= $terms ? emt('Terms') . ": $terms" : '' %>
<%= $po_line %>
- + <%= $summary %> <%= - foreach my $section ( @sections ) { - if ($section->{'pretotal'}) { + 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 .= '
'. '

'. @@ -78,86 +140,126 @@ ''. uc(substr($section->{'pretotal'},1)). ''. '

'. - '

'; - } - $OUT .= ''; } - $OUT .= '
'; - if ($section->{'description'}) { - $OUT .= - '

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

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

CHARGES'. - '

'; + '

'; + unless ($section->{'summarized'}) { + $OUT .= '
' if ( $notfirst || $section->{'pretotal'} && !$summary ); + $OUT .= '
'; + $OUT .= '

'; + my $sectionhead; + if ( $section->{'location'} ) { + $sectionhead .= $section->{'location'}{'label_prefix'}. ': ' + if length($section->{'location'}{'label_prefix'}); + $sectionhead = $section->{'location'}{'address1'}; + $sectionhead .= ', '.$section->{'location'}{'address2'} + if length($section->{'location'}{'address2'}); + $sectionhead .= ', ' . + $section->{'location'}{'city'} . ', ' . + $section->{'location'}{'state'} . ' ' . + $section->{'location'}{'zip'}; + $OUT .= $sectionhead; + } else { + $sectionhead = $section->{'description'} || emt('Charges'); + $OUT .= ''. substr($sectionhead,0,1). + ''. substr($sectionhead,1). + + ''; + } + $OUT .= '

'; - $OUT .= - ''. - ''. - ''. - ''. - ( $unitprices - ? ''. - '' - : '' - ). - ''. - ''; - - foreach my $line ( - grep { ( scalar(@sections) > 1 - ? $section->{'description'} eq $_->{'section'}->{'description'} - : 1 - ) } - @detail_items ) - { $OUT .= - ''. - ''. - ''. - ( $unitprices - ? ''. - '' - : '' - ). - - ''. - '' - ; - if ( @{$line->{'ext_description'} } ) { - $OUT .= '' : '>'; - $OUT .= '
RefDescriptionUnit PriceQuantityAmount
'. $line->{'ref'}. ''. $line->{'description'}. ''. $line->{'unit_amount'}. ''. $line->{'quantity'}. ''. $line->{'amount'}. '
'; - foreach my $ext_desc ( @{$line->{'ext_description'} } ) { - $OUT .= - ''. - ''. - '' - } - $OUT .= '
  '. $ext_desc. '
'; + ''. + ''; + + 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 ( + grep { ( scalar(@sections) > 1 + ? $section->{'description'} eq $_->{'section'}->{'description'} + : 1 + ) } + @detail_items ) + { + if ( $section->{description_generator} ) { + $OUT .= ' + + '; + if ( $unitprices ) { + $OUT .= + ''. + ''; + } + $OUT .= ''; + } + $OUT .= ''; + $lastref = $line->{'ref'} || 0; + if ( @{$line->{'ext_description'} } ) { + unless ( $section->{description_generator} ) { + $OUT .= '{'ext_description'} } ) { + $OUT .= + ''. + ( $section->{'description_generator'} ? '' : '' ). + ''. + '' + } + unless ( $section->{description_generator} ) { + $OUT .= '
' . emt('Description') . '' . emt('Unit Price') . '' . emt('Quantity') . '' . emt('Amount') . '
'; + $OUT .= ''. $line->{'description'}. ''. $line->{'unit_amount'}. ''. $line->{'quantity'}. ''. $line->{'amount'}. '
/i ? '' : 'colspan=99' ). '>'. + '  '. $ext_desc. + '
'; + } + $OUT .= ''; + } + } - if (scalar(@sections) > 1) { - my $style = 'border-top: 3px solid #000000;'. - 'border-bottom: 3px solid #000000;'; - $OUT .= - ''. - qq( ). - qq(). - $section->{'description'}. ' Total '. - qq(). - $section->{'subtotal'}. ''. - '' - ; - } + if ($section->{'description'} || $multisection and !$section->{no_subtotal}) { + my $style = 'border-top: 3px solid #000000;'. + 'border-bottom: 3px solid #000000;'; + $OUT .= + ''. + qq( ); + if ($section->{total_generator}) { + $OUT .= &{$section->{total_generator}}($section); + } else { + $OUT .= qq(' : '>' ). + $section->{'description'}. ' ' . emt('Total') . ''. + qq(). + $section->{'subtotal'}. ''; + } + $OUT .= ''; + } + } if ($section->{'posttotal'}) { - $OUT .= ''; + $OUT .= ''; $OUT .= '

'. $section->{'posttotal'}. ''. @@ -165,6 +267,8 @@ $OUT .= ''; } + $notfirst++; + } my $style = 'border-top: 3px solid #000000;'; @@ -173,18 +277,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=''; @@ -194,9 +301,15 @@

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


-

<%= $footer %> +

><%= $footer %> - +