X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_pkg.pm;h=d15eb89ac97c1141ee7ef902ae3863ecf0e39367;hp=1cc82357ea1c1e050b3a332ad99e561a2902d524;hb=099cd9cd6b789ad0ee4ce7d9ac8721ccce69b8dd;hpb=10b49cdbb4b4290f82ef08a035a84747b8cd2211 diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index 1cc82357e..d15eb89ac 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -2537,6 +2537,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'}