[freeside-commits] branch FREESIDE_2_3_BRANCH updated. d614be860df82d5e350a8c9e6c64dd4376fc20d6

Ivan ivan at 420.am
Mon Feb 4 00:48:21 PST 2013


The branch, FREESIDE_2_3_BRANCH has been updated
       via  d614be860df82d5e350a8c9e6c64dd4376fc20d6 (commit)
      from  747e560fbf3f9f688610726bbb8ea471d418467d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d614be860df82d5e350a8c9e6c64dd4376fc20d6
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Feb 4 00:48:20 2013 -0800

    better invoice summary, RT#20601

diff --git a/conf/invoice_htmlsummary b/conf/invoice_htmlsummary
index a06c8ff..a6ea1e9 100644
--- a/conf/invoice_htmlsummary
+++ b/conf/invoice_htmlsummary
@@ -34,7 +34,16 @@
         <%= 
           my ($last) = grep { $_->{tax_section} || !$_->{summarized} and !($finance_section && $_->{'description'} eq $finance_section) and $_->{'description'} !~ /^\d+ $/ } reverse @sections;
           
-          foreach my $section ( grep { $_->{tax_section} || !$_->{summarized} and !($finance_section && $_->{'description'} eq $finance_section) and $_->{'description'} !~ /^\d+ $/ } @sections ) {
+          #false laziness w/invoice_latexsummary
+          foreach my $section (
+            grep {
+                       $_->{tax_section} || !$_->{summarized}
+                   and ! $_->{adjust_section}
+                   and !($finance_section && $_->{'description'} eq $finance_section)
+                   and $_->{'description'} !~ /^\d+ $/
+                 }
+               @sections
+          ) {
             $OUT .= '<tr><td><b>'. ($section->{'description'} ? $section->{'description'} : 'Charges' ). '</b></td>';
             my $celltype = ($last == $section) ? 'th' : 'td';
             $OUT .= qq(<$celltype align="right"><b>). $section->{'subtotal'}. "</b></$celltype></tr>";
@@ -63,9 +72,19 @@
           <td><b>New Charges</b></td>
           <th align="right"><b><%= $dollar.$current_less_finance %></b></th>
         </tr>
+
+        <%= 
+          
+          #false laziness w/invoice_latexsummary and above
+          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>Total Amount Due</b></td>
-          <td align="right"><b><%= $dollar.sprintf('%.2f', $true_previous_balance + $current_charges - $balance_adjustments) %></b></td>
+          <td align="right"><b><%= $dollar.sprintf('%.2f', $balance) %></b></td>
         </tr>
         <tr><th colspan=2><br></th></tr>
       </table>
diff --git a/conf/invoice_latexsummary b/conf/invoice_latexsummary
index 4e4f62b..a68e5d3 100644
--- a/conf/invoice_latexsummary
+++ b/conf/invoice_latexsummary
@@ -21,7 +21,16 @@
 \textbf{\underline{Summary of New Charges}} & \\
 &\\
 [@--
-  foreach my $section ( grep { $_->{tax_section} || !$_->{summarized} and !($finance_section && $_->{'description'} eq $finance_section) and $_->{'description'} !~ /^\d+ $/ } @sections ) {
+  #false laziness w/invoice_htmlsummary
+  foreach my $section (
+    grep {
+               $_->{tax_section} || !$_->{summarized}
+           and ! $_->{adjust_section}
+           and !($finance_section && $_->{'description'} eq $finance_section)
+           and $_->{'description'} !~ /^\d+ $/
+         }
+      @sections
+  ) {
     $OUT .= '\textbf{'. ($section->{'description'} ? $section->{'description'} : 'Charges' ). '}';
     $OUT .= '&\textbf{'. $section->{'subtotal'}. '}\\\\';
   }
@@ -36,8 +45,17 @@
 \textbf{Previous Past Due Charges}&\textbf{\dollar[@-- sprintf('%.2f', $true_previous_balance - $balance_adjustments) --@]}\\
 \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'}. '}\\\\';
+  }
+--@]
+
 \cline{2-2}
-\textbf{Total Amount Due}&\textbf{\dollar[@-- sprintf('%.2f', $true_previous_balance + $current_charges - $balance_adjustments) --@]}\\
+\textbf{Total Amount Due}&\textbf{\dollar[@-- sprintf('%.2f', $balance) --@]}\\
 &\\
 \hline
 \end{tabular}

-----------------------------------------------------------------------

Summary of changes:
 conf/invoice_htmlsummary  |   23 +++++++++++++++++++++--
 conf/invoice_latexsummary |   22 ++++++++++++++++++++--
 2 files changed, 41 insertions(+), 4 deletions(-)




More information about the freeside-commits mailing list