X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=conf%2Finvoice_html;h=1241f870e98dfbd12ab7ec2b0369082a13233c0a;hp=2073d7ff40b8205401f24f70db832c0c9d0266a5;hb=38e34bbc53a4222c7507e95914e1364a5a74623f;hpb=b41cc79f66f4e701e0f6d973758529ebff702bf1 diff --git a/conf/invoice_html b/conf/invoice_html index 2073d7ff4..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 %>
  - <%= $notice_name ? substr($notice_name, 0, 1) : 'I' %><%= $notice_name ? uc(substr($notice_name, 1)) : 'NVOICE' %> + + <%= substr(emt($notice_name),0,1) %><%= substr(emt($notice_name),1) %>  
+ - <%= $ship_enable ? (' @@ -90,7 +134,7 @@ my $columncount = $unitprices ? 5 : 3; foreach my $section ( grep { !$summary || $_->{description} ne $finance_section } @sections ) { if ($section->{'pretotal'} && !$summary) { - $OUT .= '
+ <%= $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 %>
' if $notfirst; + $OUT .= '
' if $notfirst++; $OUT .= ''; } unless ($section->{'summarized'}) { - $OUT .= '
'. '

'. @@ -101,20 +145,32 @@ '

' if ( $notfirst || $section->{'pretotal'} && !$summary ); + 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 .= ''. @@ -125,16 +181,28 @@ $OUT .= $header; $columncount = scalar(my @array = split /<\/th>'. - ( $unitprices - ? ''. - '' - : '' - ). - ''; + my @headings = ( '', 'Description', 'Amount' ); + my @aligns = ( 'center', 'left', 'right' ); + if ( $unitprices ) { + splice @headings, 2, 0, 'Unit Price', 'Quantity'; + splice @aligns, 2, 0, 'right', 'right'; + } + if ( $section->{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 .= ' + '; + } } - $OUT .= ''; + + $OUT .= ''; my $lastref = 0; foreach my $line ( @@ -144,26 +212,39 @@ ) } @detail_items ) { - $OUT .= - '{description_generator}}($line); + } elsif ( $section->{usage_section} ) { + my $minutes = sprintf('%d', $line->{'duration'} / 60); + my $seconds = $line->{'duration'} % 60; + $OUT .= ' + + + + + + + '; } else { - $OUT .= ( ($line->{'ref'} && $line->{'ref'} ne $lastref) ? '' : '_more' ). - '">'. - ''. - ''. - ( $unitprices - ? ''. - '' - : '' - ). - - ''; + 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'}; + $lastref = $line->{'ref'} || 0; if ( @{$line->{'ext_description'} } ) { unless ( $section->{description_generator} ) { $OUT .= '{'description'} || $multisection) { + if ($section->{'description'} || $multisection and !$section->{no_subtotal}) { my $style = 'border-top: 3px solid #000000;'. 'border-bottom: 3px solid #000000;'; $OUT .= @@ -199,13 +280,13 @@ } else { $OUT .= qq('. + $section->{'description'}. ' ' . emt('Total') . ''. qq('; } $OUT .= ''; } - } + } # if !$section->{summarized} if ($section->{'posttotal'}) { $OUT .= ''; } - - $notfirst++; - } my $style = 'border-top: 3px solid #000000;'; @@ -249,6 +327,61 @@
DescriptionUnit PriceQuantityAmount' . $heading . '
' . $line->{'description'} . '' . $line->{'quantity'} . '' . $minutes . 'm ' . $seconds . 's' . '' . $line->{'amount'} . '
'. - ( $line->{'ref'} ne $lastref ? $line->{'ref'} : '' ). ''. $line->{'description'}. ''. $line->{'unit_amount'}. ''. $line->{'quantity'}. ''. $line->{'amount'}. '
'; + $OUT .= ''. $line->{'description'}. ''. $line->{'unit_amount'}. ''. $line->{'quantity'}. ''. $line->{'amount'}. '
' : '>' ). - $section->{'description'}. ' Total ). $section->{'subtotal'}. '
'; $OUT .= @@ -214,9 +295,6 @@ '

'; $OUT .= '



+<%= + + 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 @@ -260,4 +393,4 @@

><%= $footer %> - +