diff options
author | Jonathan Prykop <jonathan@freeside.biz> | 2016-03-11 00:10:13 -0600 |
---|---|---|
committer | Jonathan Prykop <jonathan@freeside.biz> | 2016-03-11 16:15:46 -0600 |
commit | 1ce2f035cac19edbbe1b31a20e954cd97e40da20 (patch) | |
tree | ee14a952c49ff854d0b089c99f8c575e2f2bb984 /FS/FS/quotation_pkg.pm | |
parent | 92715a9e433226b32150964e7b7fe0cdf3d1bddb (diff) |
RT#40806: Enter invoice details from order package page
Diffstat (limited to 'FS/FS/quotation_pkg.pm')
-rw-r--r-- | FS/FS/quotation_pkg.pm | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/FS/FS/quotation_pkg.pm b/FS/FS/quotation_pkg.pm index 1e5a0da..b9b3799 100644 --- a/FS/FS/quotation_pkg.pm +++ b/FS/FS/quotation_pkg.pm @@ -106,7 +106,11 @@ sub detail_table { 'quotation_pkg_detail'; } =item insert Adds this record to the database. If there is an error, returns the error, -otherwise returns false. +otherwise returns false. Accepts the following options: + +quotation_details - optional arrayref of detail strings to add (creates quotation_pkg_detail records) + +copy_on_order - value for this field when creating quotation_pkg_detail records (same for all details) =cut @@ -128,10 +132,22 @@ sub insert { if ( $error ) { $dbh->rollback if $oldAutoCommit; return $error; - } else { - $dbh->commit if $oldAutoCommit; - return ''; } + + if ($options{'quotation_details'}) { + $error = $self->set_details( + details => $options{'quotation_details'}, + copy_on_order => $options{'copy_on_order'} ? 'Y' : '', + ); + if ( $error ) { + $error .= ' (setting details)'; + $dbh->rollback if $oldAutoCommit; + return $error; + } + } + + $dbh->commit if $oldAutoCommit; + return ''; } =item delete |