X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=conf%2Finvoice_latex;h=4df858d22ac2f7ed5b3f027baf9583b23ad5b97f;hp=c7c696b5d33257c880a32d6b3ccfbf0509e49272;hb=9896275b96170e2a97e313e64c7aa5bfaf12a087;hpb=8d76610b4329151076c7e2b81891406df36d18bb diff --git a/conf/invoice_latex b/conf/invoice_latex index c7c696b5d..4df858d22 100644 --- a/conf/invoice_latex +++ b/conf/invoice_latex @@ -196,7 +196,20 @@ \hline } -% ...description... +\newcommand{\FSusagehead}{ + \hline + \rule{0pt}{2.5ex} + \makebox[1.4cm]{} & + \multicolumn{4}{l}{ + \makebox[\FSdescriptionlength][l]{\textbf{[@-- emt('Description') --@]}} + } & + \textbf{~~[@-- emt('Calls') --@]} & + \textbf{~~[@-- emt('Duration') --@]} & + \textbf{~~[@-- emt('Amount') --@]} \\ + \hline +} + +}% ...description... \newcommand{\FSdesc}[5]{ \multicolumn{1}{c}{\rule{0pt}{2.5ex}\textbf{#1}} & \multicolumn{[@-- $unitprices ? '4' : '6' --@]}{l}{\textbf{#2}} & @@ -217,6 +230,15 @@ & \multicolumn{6}{l}{#1} & #2\\ } +% ...usage class summary +\newcommand{\FSusagedesc}[4]{ + \multicolumn{1}{c}{\rule{0pt}{2.5ex}} & + \multicolumn{4}{l}{\textbf{#1}} & + \multicolumn{1}{r}{\textbf{#2}} & + \multicolumn{1}{r}{\textbf{#3}} & + \multicolumn{1}{r}{\textbf{#4}} + \\ +} \begin{document} % Headers and footers defined for the first page @@ -289,6 +311,8 @@ $OUT .= '}\\\\'; if ($section->{header_generator}) { $OUT .= &{$section->{header_generator}}(); + } elsif ( $section->{usage_section} ) { + $OUT .= '\FSusagehead'; } else { $OUT .= '\FShead'; } @@ -296,6 +320,8 @@ $OUT .= '\multicolumn{7}{r}{\rule{0pt}{2.5ex}'.emt('Continued from previous page').'}\\\\'; if ($section->{header_generator}) { $OUT .= &{$section->{header_generator}}(); + } elsif ( $section->{usage_section} ) { + $OUT .= '\FSusagehead'; } else { $OUT .= '\FShead'; } @@ -343,6 +369,14 @@ $OUT .= "\\hline\n" if (($line->{'ref'} || 0) ne $lastref); if ($section->{description_generator}) { $OUT .= &{$section->{description_generator}}($line); + } elsif ($section->{usage_section}) { + my $minutes = sprintf('%d', $line->{'duration'} / 60); + my $seconds = $line->{'duration'} % 60; + $OUT .= '\FSusagedesc + {' . $line->{'description'} . '} + {' . $line->{'quantity'} . '} + {' . $minutes . 'm ' . $seconds . 's' . '} + {' . '\dollar' . $line->{'amount'} . '}'; } else { $OUT .= '\FSdesc'. '{}'.