From fe6ddc9940cf3a55b4c37f360a31b90e92e4157d Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Wed, 16 Sep 2015 01:59:07 -0500 Subject: RT#36813: Monthly Recurring Total [change_to_pkgnum handling] --- httemplate/view/cust_main/billing.html | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 -- cgit v1.2.1 From c878f595e11f510058671b146e08c250766cd1bf Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Sat, 19 Sep 2015 19:36:55 -0500 Subject: RT#36813: Monthly Recurring Total [fixed order by] --- httemplate/view/cust_main/billing.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index 74484e322..cc58cd74e 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -48,7 +48,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; -- cgit v1.2.1 From 76dff99173f25f38002fbb5236d8141a8781c3eb Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Thu, 17 Sep 2015 19:27:10 -0500 Subject: RT#35197: Apply changes button in Edit rate plan screen clears the global default --- FS/FS/rate.pm | 7 +++++-- httemplate/edit/process/rate_detail.html | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/FS/FS/rate.pm b/FS/FS/rate.pm index d30517051..1164c15f2 100644 --- a/FS/FS/rate.pm +++ b/FS/FS/rate.pm @@ -491,8 +491,11 @@ sub process { warn "$rate replacing $old (". $param->{'ratenum'}. ")\n" if $DEBUG; my @param = ( 'job'=>$job ); - push @param, 'rate_detail'=>\@rate_detail - unless $param->{'preserve_rate_detail'}; + if ($param->{'preserve_rate_detail'}) { + $rate->default_detailnum($old->default_detailnum); + } else { + push @param, 'rate_detail'=>\@rate_detail; + } $error = $rate->replace( $old, @param ); diff --git a/httemplate/edit/process/rate_detail.html b/httemplate/edit/process/rate_detail.html index 0709d5079..f8a744418 100644 --- a/httemplate/edit/process/rate_detail.html +++ b/httemplate/edit/process/rate_detail.html @@ -12,7 +12,6 @@ die "access denied" my $set_default_detail = sub { my ($cgi, $rate_detail) = @_; -warn Dumper $rate_detail; if (!$rate_detail->dest_regionnum) { # then this is a global default rate my $rate = $rate_detail->rate; -- cgit v1.2.1 From 8e4a09fe86c531059bfea4b3d49599e417580198 Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Sat, 19 Sep 2015 18:11:54 -0500 Subject: RT#35197: Apply changes button in Edit rate plan screen clears the global default [removed preserve_rate_detail, always true] --- FS/FS/rate.pm | 7 ++----- httemplate/edit/rate.cgi | 4 +--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/FS/FS/rate.pm b/FS/FS/rate.pm index 1164c15f2..50657ce5f 100644 --- a/FS/FS/rate.pm +++ b/FS/FS/rate.pm @@ -491,11 +491,8 @@ sub process { warn "$rate replacing $old (". $param->{'ratenum'}. ")\n" if $DEBUG; my @param = ( 'job'=>$job ); - if ($param->{'preserve_rate_detail'}) { - $rate->default_detailnum($old->default_detailnum); - } else { - push @param, 'rate_detail'=>\@rate_detail; - } + + $rate->default_detailnum($old->default_detailnum); $error = $rate->replace( $old, @param ); diff --git a/httemplate/edit/rate.cgi b/httemplate/edit/rate.cgi index 183ea8a42..1b052d62d 100644 --- a/httemplate/edit/rate.cgi +++ b/httemplate/edit/rate.cgi @@ -5,7 +5,7 @@ <% include('/elements/progress-init.html', 'OneTrueForm', - [ 'rate', 'agentnum', 'preserve_rate_detail' ], # 'rate', 'min_', 'sec_' ], + [ 'rate', 'agentnum' ], 'process/rate.cgi', $p.'browse/rate.cgi', ) @@ -27,8 +27,6 @@
- - " onClick="document.OneTrueForm.submit.disabled=true; process();"> -- cgit v1.2.1