From 9896275b96170e2a97e313e64c7aa5bfaf12a087 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Thu, 10 Sep 2015 16:27:43 -0700 Subject: improve usage_class_summary with number of calls and total minutes, #37122 --- conf/invoice_html | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) (limited to 'conf/invoice_html') diff --git a/conf/invoice_html b/conf/invoice_html index dfd87c79b..e1af70703 100644 --- a/conf/invoice_html +++ b/conf/invoice_html @@ -176,15 +176,28 @@ $OUT .= $header; $columncount = scalar(my @array = split /<\/th>' . emt('Description') . ''. - ( $unitprices - ? '' . emt('Unit Price') . ''. - '' . emt('Quantity') . '' - : '' ). - '' . emt('Amount') . ''; + 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 .= ' + ' . $heading . ''; + } } - $OUT .= ''; + + $OUT .= ''; my $lastref = 0; foreach my $line ( @@ -197,6 +210,17 @@ if ( $section->{description_generator} ) { $OUT .= ' + + ' . $line->{'description'} . ' + ' . $line->{'quantity'} . ' + ' . $minutes . 'm ' . $seconds . 's' . ' + ' . $line->{'amount'} . ' + '; } else { my $class = 'invoice_desc_more'; if ( ($line->{'ref'} || 0) ne $lastref ) { @@ -257,7 +281,7 @@ } $OUT .= ''; } - } + } # if !$section->{summarized} if ($section->{'posttotal'}) { $OUT .= ''; $OUT .= -- cgit v1.2.1