summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2015-09-16 01:59:07 -0500
committerJonathan Prykop <jonathan@freeside.biz>2015-09-19 21:57:42 -0500
commitfe6ddc9940cf3a55b4c37f360a31b90e92e4157d (patch)
tree5eae349578933ef530fdb0a0fc100bcb7f52709a /httemplate/view/cust_main
parent2581d8f2341ac8def1a712cfe70543ec5f7b0959 (diff)
RT#36813: Monthly Recurring Total [change_to_pkgnum handling]
Diffstat (limited to 'httemplate/view/cust_main')
-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 ca48a7068..74484e322 100644
--- a/httemplate/view/cust_main/billing.html
+++ b/httemplate/view/cust_main/billing.html
@@ -48,11 +48,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
@@ -61,6 +63,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