diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-01-20 21:41:15 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-01-20 21:41:15 -0800 |
commit | 908a4522939c0225ef4e7ba4236dab2eebe9daca (patch) | |
tree | 34890c50a3642e19391cc0851bd35b28e4010e76 /FS/FS/cust_credit.pm | |
parent | e46ea78f6d233fbf0314d1386237bd225ef29035 (diff) |
credit sources, RT#28917
Diffstat (limited to 'FS/FS/cust_credit.pm')
-rw-r--r-- | FS/FS/cust_credit.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/FS/FS/cust_credit.pm b/FS/FS/cust_credit.pm index 212be7a37..dde847a56 100644 --- a/FS/FS/cust_credit.pm +++ b/FS/FS/cust_credit.pm @@ -176,6 +176,17 @@ sub insert { return "error inserting $self: $error"; } + if ( $options{'cust_credit_source_bill_pkg'} ) { + foreach my $ccsbr ( @{ $options{'cust_credit_source_bill_pkg'} } ) { + $ccsbr->crednum( $self->crednum ); + $error = $ccsbr->insert; + if ( $error ) { + $dbh->rollback if $oldAutoCommit; + return "error inserting $ccsbr: $error"; + } + } + } + $dbh->commit or die $dbh->errstr if $oldAutoCommit; #false laziness w/ cust_pay::insert |