diff options
author | Mark Wells <mark@freeside.biz> | 2016-07-07 20:22:39 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2016-07-07 20:24:17 -0700 |
commit | 31c48790731207e89a80d056dbd44e1ac6f6e453 (patch) | |
tree | ebfa1b32905a17f7cdd6d52a942fd646c28342e9 /FS/FS/cust_pkg.pm | |
parent | e18cfb0670bc742200dacee7073b5e29b4927159 (diff) |
when changing a package with scheduled expiration, transfer the expiration reason to the new package, #71623
Diffstat (limited to 'FS/FS/cust_pkg.pm')
-rw-r--r-- | FS/FS/cust_pkg.pm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index 9d20fd6..de88cc0 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -2536,6 +2536,21 @@ sub change { return "transferring package notes: $error"; } } + + # transfer scheduled expire/adjourn reasons + foreach my $action ('expire', 'adjourn') { + if ( $cust_pkg->get($action) ) { + my $reason = $self->last_cust_pkg_reason($action); + if ( $reason ) { + $reason->set('pkgnum', $cust_pkg->pkgnum); + $error = $reason->replace; + if ( $error ) { + $dbh->rollback if $oldAutoCommit; + return "transferring $action reason: $error"; + } + } + } + } my @new_supp_pkgs; |