summaryrefslogtreecommitdiff
path: root/FS/FS/cust_credit.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-01-20 21:41:15 -0800
committerIvan Kohler <ivan@freeside.biz>2015-01-20 21:41:15 -0800
commit908a4522939c0225ef4e7ba4236dab2eebe9daca (patch)
tree34890c50a3642e19391cc0851bd35b28e4010e76 /FS/FS/cust_credit.pm
parente46ea78f6d233fbf0314d1386237bd225ef29035 (diff)
credit sources, RT#28917
Diffstat (limited to 'FS/FS/cust_credit.pm')
-rw-r--r--FS/FS/cust_credit.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/FS/FS/cust_credit.pm b/FS/FS/cust_credit.pm
index 212be7a..dde847a 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