From 2f27b25ce532ac7a0b12ba1043ddbd4d71899a11 Mon Sep 17 00:00:00 2001 From: Mitch Jackson Date: Fri, 20 Apr 2018 01:11:41 +0000 Subject: [PATCH] RT# 79636 Location Summary Invoice Footer --- FS/FS/Template_Mixin.pm | 4 +++- conf/invoice_html | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ conf/invoice_latex | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+), 1 deletion(-) diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm index 9b3506156..07252d05c 100644 --- a/FS/FS/Template_Mixin.pm +++ b/FS/FS/Template_Mixin.pm @@ -942,7 +942,9 @@ sub print_generic { my $unsquelched = $params{unsquelch_cdr} || $cust_main->squelch_cdr ne 'Y'; my $multisection = $self->has_sections; - $invoice_data{'multisection'} = $multisection; + if ( $multisection ) { + $invoice_data{multisection} = $conf->config($tc.'sections_method') || 1; + } my $late_sections; my $extra_sections = []; my $extra_lines = (); diff --git a/conf/invoice_html b/conf/invoice_html index 935c94346..9e5a392a0 100644 --- a/conf/invoice_html +++ b/conf/invoice_html @@ -327,6 +327,62 @@

+<%= + + my @location_summary_sections = + grep { + ref $_->{location} + && $_->{locationnum} + && $_->{description} + && $_->{description} ne $finance_section + } @sections; + + if ( $multisection eq 'location' && scalar(@location_summary_sections) > 1 ) { + + $OUT .= ' +
+ + + + +
+

+ '.emt('Summary Of New Charges By Location').' +

+

+ + + + + + + + + + + '; + + for my $section (@location_summary_sections) { + next unless $section->{description}; + $OUT .= ' + + + + + + '; + } + + $OUT .= ' + + +
'.emt('Location').''.emt('Amount').'
'.$section->{description}.''. $section->{subtotal} .'
   
+

+ '; + + } +%> + <%= length($summary) ? '' : ( $smallernotes diff --git a/conf/invoice_latex b/conf/invoice_latex index a710cddec..6d4c536d5 100644 --- a/conf/invoice_latex +++ b/conf/invoice_latex @@ -447,6 +447,63 @@ } --@] +[@-- + + 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) -- 2.11.0