diff options
Diffstat (limited to 'conf')
-rw-r--r-- | conf/invoice_html | 65 | ||||
-rw-r--r-- | conf/invoice_htmlsummary | 27 | ||||
-rw-r--r-- | conf/invoice_latex | 58 | ||||
-rw-r--r-- | conf/invoice_latexsummary | 17 |
4 files changed, 131 insertions, 36 deletions
diff --git a/conf/invoice_html b/conf/invoice_html index d8a2d0a97..1241f870e 100644 --- a/conf/invoice_html +++ b/conf/invoice_html @@ -134,7 +134,7 @@ my $columncount = $unitprices ? 5 : 3; foreach my $section ( grep { !$summary || $_->{description} ne $finance_section } @sections ) { if ($section->{'pretotal'} && !$summary) { - $OUT .= '</table>' if $notfirst; + $OUT .= '</table>' if $notfirst++; $OUT .= '<table width="100%"><tr><td>'. '<p align="right"><b><font size="+1">'. @@ -145,7 +145,10 @@ '</td></tr>'; } unless ($section->{'summarized'}) { - $OUT .= '</table>' if ( $notfirst || $section->{'pretotal'} && !$summary ); + if ( $notfirst || $section->{'pretotal'} && !$summary ) { + $OUT .= '</table>'; + $notfirst = 1; + } $OUT .= '<table><tr><td>'; $OUT .= '<p class="allcaps"><b>'; my $sectionhead; @@ -292,9 +295,6 @@ '<p>'; $OUT .= '</td></tr>'; } - - $notfirst++; - } my $style = 'border-top: 3px solid #000000;'; @@ -327,6 +327,61 @@ </table> <br><br> +<%= + + my @location_summary_sections = + grep { + ref $_->{location} + && $_->{locationnum} + && $_->{description} + && $_->{description} ne $finance_section + } @sections; + + if ( $multisection eq 'location' && scalar(@location_summary_sections) > 1 ) { + + $OUT .= ' + <hr> + <table width="100%"> + <tr> + <td> + <p class="allcaps"> + <b>'.emt('Summary Of New Charges By Location').'</b> + <p> + </td> + </tr> + </table> + + <table class="invoice_longtable" cellspacing="0" width="100%"> + <thead> + <tr> + <th></th> + <th align="left">'.emt('Location').'</th> + <th align="right">'.emt('Amount').'</th> + </tr> + </thead> + <tbody> + '; + + for my $section (@location_summary_sections) { + next unless $section->{description}; + $OUT .= ' + <tr class="invoice_desc_more"> + <td></td> + <td>'.$section->{description}.'</td> + <td align="right">'. $section->{subtotal} .'</td> + </tr> + '; + } + + $OUT .= ' + <tr class="invoice_desc"><td> </td><td> </td><td> </td></tr> + </tbody> + </table> + <br><br> + '; + +} %> + <%= length($summary) ? '' : ( $smallernotes diff --git a/conf/invoice_htmlsummary b/conf/invoice_htmlsummary index 249db9b07..c07d7e229 100644 --- a/conf/invoice_htmlsummary +++ b/conf/invoice_htmlsummary @@ -35,15 +35,6 @@ <td align="right"><b><%= $dollar.$current_less_finance %></b></td> </tr> <tr><th colspan=2><br></th></tr> - <tr> - <td><b><u><br>Summary of Payments and Credits<br></u></b></td> - <td></td> - </tr> - <tr> - <td><b>Payments and Credits</b></td> - <td align="right"><b>-<%= $dollar.$balance_adjustments %></b></td> - </tr> - <tr><th colspan=2><br></th></tr> <tr><td colspan=2><br></td></tr> <tr> <td><b><u>Invoice Summary</u></b></td> @@ -61,16 +52,14 @@ <td><b>New Charges</b></td> <td align="right"><b><%= $dollar.$current_less_finance %></b></td> </tr> - <%= - foreach my $section ( grep $_->{adjust_section}, @sections) { - $OUT .= '<tr><td><b>'. ($section->{'description'} ? $section->{'description'} : 'Charges' ). '</b></td>'; - $OUT .= qq(<th align="right"><b>). $section->{'subtotal'}. "</b></th></tr>"; - } - %> - <tr> - <td><b>Payments and Credits</b></td> - <th align="right"><b>-<%= $dollar.sprintf('%.2f', $balance_adjustments) %></b></th> - </tr> + <%= if ( $balance_adjustments > 0 ) { + $OUT .= " + <tr> + <td><b>Payments and Credits</b></td> + <th align='right'><b>-$dollar" . sprintf('%.2f', $balance_adjustments). "</b></th> + </tr> + "; + } %> <tr> <td><b>Total Amount Due</b></td> <td align="right"><b><%= $dollar.sprintf('%.2f', $balance) %></b></td> diff --git a/conf/invoice_latex b/conf/invoice_latex index a710cddec..478405ebd 100644 --- a/conf/invoice_latex +++ b/conf/invoice_latex @@ -447,6 +447,64 @@ }
--@]
+[@--
+
+ my @location_summary_sections =
+ grep {
+ ref $_->{location}
+ && $_->{locationnum}
+ && $_->{description}
+ && $_->{description} ne $finance_section
+ } @sections;
+ if ( $multisection eq 'location' && scalar(@location_summary_sections) > 1 ) {
+
+$OUT .= '
+ \hline
+ \section*{}
+ \captionsetup{singlelinecheck=false,justification=raggedright,font={Large,sc,bf}}
+ \ifthenelse{\equal{\thepage}{1}}{\setlength{\LTextracouponspace}{\extracouponspace}}{\setlength{\LTextracouponspace}{0pt}}
+
+ \begin{longtable}{cllllllr}
+ \caption*{ '. emt('Summary of New Charges by Location') .' }
+ \\\\
+
+ \hline
+ \rule{0pt}{2.5ex}
+ \makebox[1.4cm]{} &
+ \multicolumn{6}{l}{
+ \truncate{13.0cm}{\textbf{'. emt('Location') .'}}
+ } &
+ \makebox[1.6cm][r]{\textbf{'. emt('Amount') .'}} \\\\
+ \hline
+
+ \endfirsthead
+ \multicolumn{7}{r}{\rule{0pt}{2.5ex}'. emt('Continued from previous page') .'}
+ \\
+ \FShead
+ \endhead
+ \multicolumn{7}{r}{\rule{0pt}{2.5ex}'. emt('Continued on next page...') .'}
+ \\
+ \endfoot
+ \hline
+ \endlastfoot
+ \hline
+ ';
+
+ for my $section (@location_summary_sections) {
+ $OUT.= '
+ \rule{0pt}{2.5ex}
+ \makebox[1.4cm]{} &
+ \multicolumn{6}{l}{
+ \truncate{12.0cm}{\textbf{'. $section->{description} .'}}
+ } &
+ \makebox[1.6cm][r]{\textbf{'. $section->{subtotal} .'}} \\\\
+ ';
+ }
+
+ $OUT .= '\end{longtable}';
+ }
+--@]
+
\vfill
\begin{minipage}[t]{\textwidth}
[@-- length($summary)
diff --git a/conf/invoice_latexsummary b/conf/invoice_latexsummary index bd4ea6975..3b13327dc 100644 --- a/conf/invoice_latexsummary +++ b/conf/invoice_latexsummary @@ -9,12 +9,9 @@ \begin{tabular}{lr} \hline &\\ -\textbf{\underline{Summary of Previous Balance and Payments}} & \\ +\textbf{\underline{Summary of Previous Balance}} & \\ &\\ -\textbf{Previous Balance}&\textbf{\dollar[@-- $true_previous_balance --@]}\\ -\textbf{Payments}&\textbf{\dollar[@-- $balance_adjustments --@]}\\ -\cline{2-2} -\textbf{Balance Outstanding}&\textbf{\dollar[@-- sprintf('%.2f', $true_previous_balance -$balance_adjustments) --@]}\\ +\textbf{Previous Balance}&\textbf{\dollar[@-- sprintf('%.2f', $true_previous_balance) --@]}\\ &\\ \hline &\\ @@ -33,18 +30,14 @@ &\\ \textbf{\underline{Invoice Summary}} & \\ & \\ -\textbf{Previous Past Due Charges}&\textbf{\dollar[@-- sprintf('%.2f', $true_previous_balance - $balance_adjustments) --@]}\\ +\textbf{Previous Past Due Charges}&\textbf{\dollar[@-- sprintf('%.2f', $true_previous_balance) --@]}\\ \textbf{Finance charges on overdue amount}&\textbf{\dollar[@-- $finance_amount --@]}\\ \textbf{New Charges}&\textbf{\dollar[@-- $current_less_finance --@]}\\ - [@-- - #false laziness w/invoice_htmlsummary and above - foreach my $section ( grep $_->{adjust_section}, @sections ) { - $OUT .= '\textbf{'. ($section->{'description'} ? $section->{'description'} : 'Charges' ). '}'; - $OUT .= '&\textbf{'. $section->{'subtotal'}. '}\\\\'; + if ( $balance_adjustments > 0 ) { + $OUT .= '\textbf{Payments and Credits}&\textbf{-\dollar'.$balance_adjustments.'}\\\\' } --@] - \cline{2-2} \textbf{Total Amount Due}&\textbf{\dollar[@-- sprintf('%.2f', $balance) --@]}\\ &\\ |