RT# 78190,42357 Correct layout discrepancies for bill summary
authorMitch Jackson <mitch@freeside.biz>
Sun, 15 Apr 2018 21:41:32 +0000 (16:41 -0500)
committerMitch Jackson <mitch@freeside.biz>
Sun, 15 Apr 2018 21:41:32 +0000 (16:41 -0500)
conf/invoice_htmlsummary
conf/invoice_latexsummary

index 249db9b..c07d7e2 100644 (file)
           <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>
           <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>
index 5286841..3b13327 100644 (file)
@@ -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) --@]}\\
+\textbf{Previous Balance}&\textbf{\dollar[@-- sprintf('%.2f', $true_previous_balance) --@]}\\
 &\\
 \hline
 &\\
 \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) --@]}\\
 &\\