diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2016-11-01 16:20:01 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2016-11-01 16:20:01 -0700 |
| commit | 49cacb5122d8daacd41903d709681901501be0e5 (patch) | |
| tree | 28465e181a64a0f024136bef61173b2d497233f7 /FS | |
| parent | e3dbd4594395231687cc1b92cbe32d2f82693392 (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 9854c4594..3f6742c79 100644 --- a/FS/FS/quotation_pkg.pm +++ b/FS/FS/quotation_pkg.pm @@ -121,6 +121,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->setup_discountnum || $self->recur_discountnum) ) { |
