summaryrefslogtreecommitdiff
path: root/FS/FS/cust_credit.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-12-21 00:07:41 -0800
committerIvan Kohler <ivan@freeside.biz>2012-12-21 00:07:41 -0800
commitc6e21dc3379f34f23896f2a09731c34981ab6018 (patch)
treeee652437e04009abf822465abf2f8e75c2e5a27b /FS/FS/cust_credit.pm
parent8ae921f9d6b1405e3712a7626b80014cd29d5259 (diff)
add option _not_ to apply a lineitem credit, RT#18676
Diffstat (limited to 'FS/FS/cust_credit.pm')
-rw-r--r--FS/FS/cust_credit.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/FS/FS/cust_credit.pm b/FS/FS/cust_credit.pm
index 18d8bed..fe9572f 100644
--- a/FS/FS/cust_credit.pm
+++ b/FS/FS/cust_credit.pm
@@ -629,6 +629,7 @@ Example:
'billpkgnums' => \@billpkgnums,
'setuprecurs' => \@setuprecurs,
'amounts' => \@amounts,
+ 'apply' => 1, #0 leaves the credit unapplied
#the credit
'newreasonnum' => scalar($cgi->param('newreasonnum')),
@@ -706,6 +707,11 @@ sub credit_lineitems {
return "Error inserting credit: $error";
}
+ unless ( $arg{'apply'} ) {
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ return '';
+ }
+
#my $subtotal = 0;
my $taxlisthash = {};
my %cust_credit_bill = ();