summaryrefslogtreecommitdiff
path: root/httemplate/view
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2015-09-20 10:00:57 -1000
committerMark Wells <mark@freeside.biz>2015-09-20 10:00:57 -1000
commit376b2a33216bcc6c4ba673e6d37adb6e53fa73ac (patch)
treefc040b579d26a79bb4cac1d908f45879ff355a63 /httemplate/view
parent7d6a4045a2d2ebdb0e78bf807ed77138b7a90b04 (diff)
parent7fc8d0203dc714bf6d320fed612833d513ba9f27 (diff)
Merge branch 'FREESIDE_4_BRANCH' of git.freeside.biz:/home/git/freeside into 4.x
Diffstat (limited to 'httemplate/view')
-rw-r--r--httemplate/view/cust_main/billing.html11
1 files changed, 11 insertions, 0 deletions
diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html
index c031ce929..0c9f74a7c 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 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;
%
% 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