projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3599ddd
)
during scheduled package changes, keep setup and bill dates, #30223
author
Mark Wells
<mark@freeside.biz>
Mon, 13 Apr 2015 22:46:40 +0000
(15:46 -0700)
committer
Mark Wells
<mark@freeside.biz>
Mon, 13 Apr 2015 22:46:40 +0000
(15:46 -0700)
FS/FS/cust_pkg.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cust_pkg.pm
b/FS/FS/cust_pkg.pm
index
8153bcc
..
6fbc2d6
100644
(file)
--- a/
FS/FS/cust_pkg.pm
+++ b/
FS/FS/cust_pkg.pm
@@
-2071,6
+2071,7
@@
sub change {
my $unused_credit = 0;
my $keep_dates = $opt->{'keep_dates'};
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
# 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
@@
-2131,6
+2132,15
@@
sub change {
$cust_pkg->set("change_$_", $self->get($_));
}
$cust_pkg->set('change_date', $time);
$cust_pkg->set("change_$_", $self->get($_));
}
$cust_pkg->set('change_date', $time);
+ $cust_pkg->set('start_date', ''); # it's starting now
+ # if we are crediting unused time, then create the new package as a new
+ # package, charge its setup fee, etc. (same as an immediate change)
+ if (! $unused_credit) {
+ foreach my $date ( qw(setup bill last_bill susp adjourn resume
+ contract_end ) ) {
+ $cust_pkg->set($date, $self->getfield($date));
+ }
+ }
$error = $cust_pkg->replace;
} else {
$error = $cust_pkg->replace;
} else {