- $OUT .= '<th align="center">Ref</th>'.
- '<th align="left">Description</th>'.
- ( $unitprices
- ? '<th align="left">Unit Price</th>'.
- '<th align="left">Quantity</th>'
- : ''
- ).
- '<th align="right">Amount</th>';
+ 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 .= '
+ <th align="' . $align . '">' . $heading . '</th>';
+ }