X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=conf%2Finvoice_html;h=1241f870e98dfbd12ab7ec2b0369082a13233c0a;hp=73dcc2e426988e414a7170e56cbb906e7b053574;hb=38e34bbc53a4222c7507e95914e1364a5a74623f;hpb=947c1f964f1304242f8a6ffabacccf040f1d505e diff --git a/conf/invoice_html b/conf/invoice_html index 73dcc2e42..1241f870e 100644 --- a/conf/invoice_html +++ b/conf/invoice_html @@ -1,6 +1,18 @@ -
+
+ +
+ <%= $watermark %> +
- + +
"> <%= $returnaddress %>"> -
- 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) %>  
+ - <%= $ship_enable ? (' @@ -86,8 +130,11 @@
+ <%= $payname %>
@@ -64,7 +100,7 @@ %>
'. - join('
',grep length($_), 'Service Address', + join('
',grep length($_), ''.emt('Service Address').'', $ship_company, $ship_address1, $ship_address2, @@ -78,7 +114,15 @@ : '' %>
- Terms: <%= $terms %>
+ <%= + if($barcode_cid) { + $OUT .= qq!
!; + } + elsif($barcode_img) { + $OUT .= qq!
!; + } + %> + <%= $terms ? emt('Terms') . ': ' . emt($terms) : '' %>
<%= $po_line %>
<%= $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,35 +142,67 @@ ''. uc(substr($section->{'pretotal'},1)). ''. '

'. - '

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

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

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

CHARGES'. - '

'; + $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 .= '

'; $OUT .= ''. - ''. - ''. - ''. - ( $unitprices - ? ''. - '' - : '' - ). - ''. - ''; + ''; + + if ($section->{header_generator}) { + my $header = &{$section->{header_generator}}(); + $OUT .= $header; + $columncount = scalar(my @array = split /<\/th>'; + } + } + + $OUT .= ''; my $lastref = 0; foreach my $line ( @@ -133,65 +212,89 @@ ) } @detail_items ) { - $OUT .= - ''. - ''. - ''. - ( $unitprices - ? ''. - '' - : '' - ). - - ''. - '' - ; - $lastref = $line->{'ref'}; + if ( $section->{description_generator} ) { + $OUT .= ' + + + + + + '; + } else { + my $class = 'invoice_desc_more'; + if ( ($line->{'ref'} || 0) ne $lastref ) { + # then it's a new package (not a continuation) + $class = 'invoice_desc'; + } + $OUT .= ' + + '; + if ( $unitprices ) { + $OUT .= + ''. + ''; + } + $OUT .= ''; + } + $OUT .= ''; + $lastref = $line->{'ref'} || 0; if ( @{$line->{'ext_description'} } ) { - $OUT .= '' : '>'; - $OUT .= '
RefDescriptionUnit PriceQuantityAmount
{usage_section} ) { + @headings = ( '', 'Description', 'Calls', 'Duration', 'Amount' ); + @aligns = ( '', 'left', 'right', 'right', 'right' ); + $columncount = 5; + } + + while ( @headings ) { + my $heading = shift @headings; + $heading = emt($heading) if $heading; + my $align = shift @aligns; + $OUT .= ' + ' . $heading . '
'. - ( $line->{'ref'} ne $lastref ? $line->{'ref'} : '' ). ''. $line->{'description'}. ''. $line->{'unit_amount'}. ''. $line->{'quantity'}. ''. $line->{'amount'}. '
' . $line->{'description'} . '' . $line->{'quantity'} . '' . $minutes . 'm ' . $seconds . 's' . '' . $line->{'amount'} . '
'; + $OUT .= ''. $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. '
'; + unless ( $section->{description_generator} ) { + $OUT .= ''; + } + $OUT .= ''; } } - if (scalar(@sections) > 1) { + if ($section->{'description'} || $multisection and !$section->{no_subtotal}) { 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'}. ' ' . emt('Total') . ''. + qq(). + $section->{'subtotal'}. ''; + } + $OUT .= ''; } - } + } # if !$section->{summarized} if ($section->{'posttotal'}) { - $OUT .= ''; + $OUT .= ''; $OUT .= '

'. $section->{'posttotal'}. ''. '

'; $OUT .= ''; } - } my $style = 'border-top: 3px solid #000000;'; @@ -200,18 +303,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 +327,70 @@

-<%= length($summary) ? '' : $notes %> +<%= + + my @location_summary_sections = + grep { + ref $_->{location} + && $_->{locationnum} + && $_->{description} + && $_->{description} ne $finance_section + } @sections; + + if ( $multisection eq 'location' && scalar(@location_summary_sections) > 1 ) { + + $OUT .= ' +


+ + + + +
+

+ '.emt('Summary Of New Charges By Location').' +

+

+ + + + + + + + + + + '; + + for my $section (@location_summary_sections) { + next unless $section->{description}; + $OUT .= ' + + + + + + '; + } + + $OUT .= ' + + +
'.emt('Location').''.emt('Amount').'
'.$section->{description}.''. $section->{subtotal} .'
   
+

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

<%= $footer %> +

><%= $footer %> - +