[freeside-commits] branch FREESIDE_4_BRANCH updated. 46b8fda3ffb17a2aabf7c9cbee68e988400d6273
Mark Wells
mark at 420.am
Fri Apr 8 15:23:29 PDT 2016
The branch, FREESIDE_4_BRANCH has been updated
via 46b8fda3ffb17a2aabf7c9cbee68e988400d6273 (commit)
from 31cbce8b195f2aa5b52f066f9d3959fd8d5321cb (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 46b8fda3ffb17a2aabf7c9cbee68e988400d6273
Author: Mark Wells <mark at freeside.biz>
Date: Fri Apr 8 15:20:05 2016 -0700
prevent package change from starting the new package on hold, #38564
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index f2bf644..31f2e82 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -2139,7 +2139,7 @@ sub change {
my $time = time;
- $hash{'setup'} = $time if $self->setup;
+ $hash{'setup'} = $time if $self->get('setup');
$hash{'change_date'} = $time;
$hash{"change_$_"} = $self->$_()
@@ -2160,16 +2160,18 @@ sub change {
my $unused_credit = 0;
my $keep_dates = $opt->{'keep_dates'};
- # Special case. If the pkgpart is changing, and the customer is
- # going to be credited for remaining time, don't keep setup, bill,
- # or last_bill dates, and DO pass the flag to cancel() to credit
- # the customer.
+ # Special case. If the pkgpart is changing, and the customer is going to be
+ # credited for remaining time, don't keep setup, bill, or last_bill dates,
+ # and DO pass the flag to cancel() to credit the customer. If the old
+ # package had a setup date, set the new package's setup to the package
+ # change date so that it has the same status as before.
if ( $opt->{'pkgpart'}
and $opt->{'pkgpart'} != $self->pkgpart
and $self->part_pkg->option('unused_credit_change', 1) ) {
$unused_credit = 1;
$keep_dates = 0;
- $hash{$_} = '' foreach qw(setup bill last_bill);
+ $hash{'last_bill'} = '';
+ $hash{'bill'} = '';
}
if ( $keep_dates ) {
-----------------------------------------------------------------------
Summary of changes:
FS/FS/cust_pkg.pm | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
More information about the freeside-commits
mailing list