[freeside-commits] branch FREESIDE_4_BRANCH updated. 0f3af066f679296c0f4c563f6f8a850072f949f6

Jonathan Prykop jonathan at 420.am
Sat Sep 19 19:49:03 PDT 2015


The branch, FREESIDE_4_BRANCH has been updated
       via  0f3af066f679296c0f4c563f6f8a850072f949f6 (commit)
       via  64a2c644f1cb10cf1c37ef1941dc3406f21d94ed (commit)
      from  77a4ccff7384368888fe88379f01f9ddc34244d8 (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 0f3af066f679296c0f4c563f6f8a850072f949f6
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Sat Sep 19 19:36:55 2015 -0500

    RT#36813: Monthly Recurring Total [fixed order by]

diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html
index f7ea68a..0c9f74a 100644
--- a/httemplate/view/cust_main/billing.html
+++ b/httemplate/view/cust_main/billing.html
@@ -44,7 +44,7 @@
 %       'hashref'   => { 'custnum' => $cust_main->custnum, },
 %       'extra_sql' => 'AND ( cancel IS NULL OR cancel = 0 )
 %                       AND freq = '. dbh->quote($freq),
-%       'order_by'  => 'ORDER BY pkgnum', # to ensure old pkgs come before change_to_pkg
+%       'order_by'  => 'ORDER BY COALESCE(start_date,0), pkgnum', # to ensure old pkgs come before change_to_pkg
 %     }) or next;
 % 
 %     my $freq_pretty = $cust_pkg[0]->part_pkg->freq_pretty;

commit 64a2c644f1cb10cf1c37ef1941dc3406f21d94ed
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Wed Sep 16 01:59:07 2015 -0500

    RT#36813: Monthly Recurring Total [change_to_pkgnum handling]

diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html
index c031ce9..f7ea68a 100644
--- a/httemplate/view/cust_main/billing.html
+++ b/httemplate/view/cust_main/billing.html
@@ -44,11 +44,13 @@
 %       'hashref'   => { 'custnum' => $cust_main->custnum, },
 %       'extra_sql' => 'AND ( cancel IS NULL OR cancel = 0 )
 %                       AND freq = '. dbh->quote($freq),
+%       'order_by'  => 'ORDER BY pkgnum', # to ensure old pkgs come before change_to_pkg
 %     }) or next;
 % 
 %     my $freq_pretty = $cust_pkg[0]->part_pkg->freq_pretty;
 %
 %     my $amount = 0;
+%     my $skip_pkg = {};
 %     foreach my $cust_pkg (@cust_pkg) {
 %       my $part_pkg = $cust_pkg->part_pkg;
 %       next if $cust_pkg->susp
@@ -57,6 +59,15 @@
 %                 || $cust_pkg->option('no_suspend_bill')
 %               );
 %
+%       #pkg change handling
+%       next if $skip_pkg->{$cust_pkg->pkgnum};
+%       if ($cust_pkg->change_to_pkgnum) {
+%         #if change is on or before next bill date, use new pkg
+%         next if $cust_pkg->expire <= $cust_pkg->bill;
+%         #if change is after next bill date, use old (this) pkg
+%         $skip_pkg->{$cust_pkg->change_to_pkgnum} = 1;
+%       }
+%
 %       my $pkg_amount = 0;
 %
 %       #add recurring amounts for this package and its billing add-ons

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

Summary of changes:
 httemplate/view/cust_main/billing.html |   11 +++++++++++
 1 file changed, 11 insertions(+)




More information about the freeside-commits mailing list