'billpkgnums' => \@billpkgnums,
'setuprecurs' => \@setuprecurs,
'amounts' => \@amounts,
+ 'apply' => 1, #0 leaves the credit unapplied
#the credit
'newreasonnum' => scalar($cgi->param('newreasonnum')),
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 = ();
</TD>
</TR>
+% if ( $conf->exists('credits-auto-apply-disable') ) {
+ <INPUT TYPE="HIDDEN" NAME="apply" VALUE="no">
+% } else {
+ <TR>
+ <TD ALIGN="right"><% mt('Apply to selected line items') |h %></TD>
+ <TD><SELECT NAME="apply"><OPTION VALUE="yes" SELECTED><% mt('yes') |h %><OPTION><% mt('no') |h %></SELECT></TD>
+ </TR>
+% }
+
</table>
<BR>
'billpkgnums' => \@billpkgnums,
'setuprecurs' => \@setuprecurs,
'amounts' => \@amounts,
+ 'apply' => ( $cgi->param('apply') eq 'yes' ),
#the credit
'newreasonnum' => scalar($cgi->param('newreasonnum')),