From 31c48790731207e89a80d056dbd44e1ac6f6e453 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Thu, 7 Jul 2016 20:22:39 -0700 Subject: when changing a package with scheduled expiration, transfer the expiration reason to the new package, #71623 --- FS/FS/cust_pkg.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'FS/FS/cust_pkg.pm') 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; -- cgit v1.1