X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=conf%2Finvoice_html;h=d8a2d0a97d5bc2a128b74ce5f644342e5428f8f8;hb=b843454941061c79410d2b0efc8da5124e1021e2;hp=795242d5dcc66807fd52f72aefb48cc25ccfa4d4;hpb=5556814b7ff65b0a4837390be9331e1841189427;p=freeside.git diff --git a/conf/invoice_html b/conf/invoice_html index 795242d5d..d8a2d0a97 100644 --- a/conf/invoice_html +++ b/conf/invoice_html @@ -1,6 +1,18 @@ -
+
+ +
+ <%= $watermark %> +
- + +
"> <%= $returnaddress %>"> @@ -50,9 +83,11 @@
+ - @@ -115,7 +150,7 @@ $OUT .= '

'; my $sectionhead; if ( $section->{'location'} ) { - $sectionhead .= $section->{'location'}{'label_prefix'}. ': '. + $sectionhead .= $section->{'location'}{'label_prefix'}. ': ' if length($section->{'location'}{'label_prefix'}); $sectionhead = $section->{'location'}{'address1'}; $sectionhead .= ', '.$section->{'location'}{'address2'} @@ -143,15 +178,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 ( @@ -161,26 +209,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 .= '{summarized} if ($section->{'posttotal'}) { $OUT .= '
+ <%= $payname %>
@@ -87,7 +122,7 @@ $OUT .= qq!
!; } %> - <%= $terms ? emt('Terms') . ": $terms" : '' %>
+ <%= $terms ? emt('Terms') . ': ' . emt($terms) : '' %>
<%= $po_line %>
'. - '' . emt('Description') . '' . emt('Unit Price') . '' . emt('Quantity') . '' . emt('Amount') . '' . $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'}. '
'; $OUT .= @@ -277,4 +338,4 @@

><%= $footer %> -

+