diff options
author | Ivan Kohler <ivan@freeside.biz> | 2016-11-01 16:21:06 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2016-11-01 16:21:06 -0700 |
commit | 7df69c8d38d07327d11c009a08f8cf3fa1891cd0 (patch) | |
tree | c33f8884ee69746142b8a6e6c183807584777429 /FS | |
parent | 125e0f4ef17299fd25d7dacfccdc5fa5f23a4a9d (diff) |
fix adding a new location on a quotation, RT#73236
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/quotation_pkg.pm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/FS/FS/quotation_pkg.pm b/FS/FS/quotation_pkg.pm index 959c4622e..f4d5d5d0a 100644 --- a/FS/FS/quotation_pkg.pm +++ b/FS/FS/quotation_pkg.pm @@ -114,6 +114,22 @@ sub insert { my $oldAutoCommit = $FS::UID::AutoCommit; local $FS::UID::AutoCommit = 0; + #false laziness w/cust_main::Packages::order_pkg + if ( $options{'locationnum'} and $options{'locationnum'} != -1 ) { + + $self->locationnum($options{'locationnum'}); + + } elsif ( $options{'cust_location'} ) { + + my $error = $options{'cust_location'}->find_or_insert; + if ( $error ) { + $dbh->rollback if $oldAutoCommit; + return "inserting cust_location (transaction rolled back): $error"; + } + $self->locationnum($options{'cust_location'}->locationnum); + + } + my $error = $self->SUPER::insert; if ( !$error and $self->discountnum ) { |