diff options
author | Mark Wells <mark@freeside.biz> | 2016-05-31 12:39:43 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2016-05-31 12:40:09 -0700 |
commit | cfaa3c1e8c173571e17fcd5aafcbec3524e01af3 (patch) | |
tree | 97bbe357f64f2ab2fe784383e55883645e1ca0fe /FS/FS/cust_pkg.pm | |
parent | ad97e38e5136d585d8cd97137ceddffa05e62522 (diff) |
fix change_later vs. new package locations, #42397
Diffstat (limited to 'FS/FS/cust_pkg.pm')
-rw-r--r-- | FS/FS/cust_pkg.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index ed9e1c8..d222da7 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -2544,6 +2544,16 @@ sub change_later { return "start_date $date is in the past"; } + # If the user entered a new location, set it up now. + if ( $opt->{'cust_location'} ) { + $error = $opt->{'cust_location'}->find_or_insert; + if ( $error ) { + $dbh->rollback if $oldAutoCommit; + return "creating location record: $error"; + } + $opt->{'locationnum'} = $opt->{'cust_location'}->locationnum; + } + if ( $self->change_to_pkgnum ) { my $change_to = FS::cust_pkg->by_key($self->change_to_pkgnum); my $new_pkgpart = $opt->{'pkgpart'} |