- $OUT .= "\\hline\n" if ($line->{'ref'} && $line->{'ref'} ne $lastref);\r
- $OUT .= '\FSdesc'.\r
- '{' . ( $line->{'ref'} ne $lastref ? $line->{'ref'} : '' ) . '}'.\r
- '{' . $line->{'description'} . '}' .\r
- '{' . ( $unitprices ? $line->{'unit_amount'} : '' ) . '}'.\r
- '{' . ( $unitprices ? $line->{'quantity'} : '' ) . '}' .\r
- '{' . $line->{'amount'} . "}${rowbreak}\n";\r
- $lastref = $line->{'ref'};\r
+ $OUT .= "\\hline\n" if (($line->{'ref'} || 0) ne $lastref);\r
+ if ($section->{description_generator}) {\r
+ $OUT .= &{$section->{description_generator}}($line);\r
+ } elsif ($section->{usage_section}) {\r
+ my $minutes = sprintf('%d', $line->{'duration'} / 60);\r
+ my $seconds = $line->{'duration'} % 60;\r
+ $OUT .= '\FSusagedesc\r
+ {' . $line->{'description'} . '}\r
+ {' . $line->{'quantity'} . '}\r
+ {' . $minutes . 'm ' . $seconds . 's' . '}\r
+ {' . $line->{'amount'} . '}';\r
+ } else {\r
+ $OUT .= '\FSdesc'.\r
+ '{}'.\r
+ '{' . $line->{'description'} . '}' ;\r
+ if ( $unitprices and length($line->{'unit_amount'}) ) {\r
+ # then show the unit amount and quantity\r
+ $OUT .= \r
+ '{\\dollar' . $line->{'unit_amount'} . '}'.\r
+ '{' . $line->{'quantity'} . '}';\r
+ } else {\r
+ # leave those columns blank\r
+ $OUT .= '{}{}';\r
+ }\r
+ $OUT .= '{\\dollar' . $line->{'amount'} . "}${rowbreak}\n";\r
+ }\r
+ $lastref = $line->{'ref'} || 0;\r