summaryrefslogtreecommitdiff
path: root/conf/invoice_htmlsummary
diff options
context:
space:
mode:
authorMitch Jackson <mitch@freeside.biz>2017-11-15 07:51:40 +0000
committerMitch Jackson <mitch@freeside.biz>2017-11-16 05:30:09 +0000
commit22dd0016d0938f6acb2127d8168a4a1c5e296d3f (patch)
tree361e4a80f7f8812a1d6506d303c97430ad277c30 /conf/invoice_htmlsummary
parentf228534e7bc57e615657d6a8b9c09069f34f914e (diff)
Fixed invoice inconsistencies with various conf flags RT#78190
Applying different invoicing conf flags manifested different variations of the same problem. Addressed by this fix: - Incorrect items listed for Previous Balance - Incorrect Items listed for applied payments and credits - Incorrect subtotals for various sections - Invoice amounts, subtotals, balances displayed did not reconcile. Because of which data was selected for display, columns could appear to have bad math. No account balances were factually incorrect. - Items disappearing from invoices used a payment receipts or "statements" giving a false impression of overpayment or credits - Applied payments or credits appearing on the wrong statements - A single applied credit appearing on up to 3 invoices - When viewing older invoices, future payments for future bills shown on, and appearing to apply to, the older invoice - Inconsistencies of line items and numbers between website, email, pdf and txt version invoices. - Invoice summary page numbers not matching the invoice - Incorrect balances shown on on aging line - Update item order on invoice_htmlsummary mason template Conf flags involved in these issues: - disable_previous_balance - previous_balance-payments_since - previous_balance-summary_only - previous_balance-show_on_statements - previous_balance-section - previous_balance-exclude_from_total - invoice_include_aging - invoice_show_prior_due_date - invoice_usesummary New invoice template stash variables made available: - aged_balance_current - aged_balance_30d - aged_balance_60d - aged_balance_90d Solved by updating, or creating, FS::cust_bill helper methods that generate data to be displayed on invoices. These helper methods are responsive to various conf flags. Updated template pipeline to use these helpers instead of inconsistent sql queries. Resolves: #78190 See Also: #75709, #76161, #74426
Diffstat (limited to 'conf/invoice_htmlsummary')
-rw-r--r--conf/invoice_htmlsummary39
1 files changed, 19 insertions, 20 deletions
diff --git a/conf/invoice_htmlsummary b/conf/invoice_htmlsummary
index 47bdbfb..249db9b 100644
--- a/conf/invoice_htmlsummary
+++ b/conf/invoice_htmlsummary
@@ -9,29 +9,20 @@
<table class="invoice_summary">
<tr><th colspan=2><br></th></tr>
<tr>
- <td><b><u><br>Summary of Previous Balance and Payments<br></u></b></td>
+ <td><b><u><br>Summary of Previous Balance<br></u></b></td>
<td></td>
</tr>
<tr>
<td><b>Previous Balance</b></td>
- <td align="right"><b><%= $dollar.$true_previous_balance %></b></td>
- </tr>
- <tr>
- <td><b>Payments</b></td>
- <th align="right"><b><%= $dollar.$balance_adjustments %></b></th>
- </tr>
- <tr>
- <td><b>Balance Outstanding</b></td>
- <td align="right"><b><%= $dollar.sprintf('%.2f', $true_previous_balance - $balance_adjustments) %></b></td>
+ <td align=right><b><%= "${dollar}${true_previous_balance}" %></b></td>
</tr>
<tr><th colspan=2><br></th></tr>
<tr><td colspan=2><br></td></tr>
<tr>
<td><b><u>Summary of New Charges</u></b></td>
- <td></td>
</tr>
<tr><td colspan=2><br></td></tr>
- <%=
+ <%=
my $last = $summary_subtotals[-1];
foreach my $section (@summary_subtotals) {
$OUT .= '<tr><td><b>'. ($section->{'description'} ? $section->{'description'} : 'Charges' ). '</b></td>';
@@ -44,15 +35,23 @@
<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></td>
</tr>
<tr><td colspan=2><br></td></tr>
<tr>
<td><b>Previous Past Due Charges</b></td>
- <td align="right"><b><%= $dollar.sprintf('%.2f', $true_previous_balance - $balance_adjustments) %></b></td>
+ <td align="right"><b><%= $dollar.$true_previous_balance %></b></td>
</tr>
<tr>
<td><b>Finance charges on overdue amount</b></td>
@@ -60,18 +59,18 @@
</tr>
<tr>
<td><b>New Charges</b></td>
- <th align="right"><b><%= $dollar.$current_less_finance %></b></th>
+ <td align="right"><b><%= $dollar.$current_less_finance %></b></td>
</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>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>