From: Jonathan Prykop Date: Thu, 25 Feb 2016 17:27:03 +0000 (-0600) Subject: RT#30600: Auto Apply for CC payments [no_invnum flag] X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=5c98d3c21d07442fcf6d5a21aaef3e1fd5a206ca RT#30600: Auto Apply for CC payments [no_invnum flag] --- diff --git a/FS/FS/cust_main/Billing_Realtime.pm b/FS/FS/cust_main/Billing_Realtime.pm index 345568a15..20b21dc0b 100644 --- a/FS/FS/cust_main/Billing_Realtime.pm +++ b/FS/FS/cust_main/Billing_Realtime.pm @@ -129,9 +129,13 @@ specified invoice. If the customer has exactly one open invoice, that invoice number will be assumed. If you don't specify an I you might want to call the B method or set the I option. +I can be set to true to prevent that default invnum from being set. + I can be set to true to run B on success. -I can be set to true to prevent resulting payment from being automatically applied. +I can be set to true to set that flag on the resulting payment +(prevents payment from being applied by B or B, +but will still be applied if I exists...use with I for intended effect.) I can be set true to surpress email decline notices. @@ -245,7 +249,7 @@ sub _bop_defaults { } # Default invoice number if the customer has exactly one open invoice. - if( ! $options->{'invnum'} ) { + unless ( $options->{'invnum'} || $options->{'no_invnum'} ) { $options->{'invnum'} = ''; my @open = $self->open_cust_bill; $options->{'invnum'} = $open[0]->invnum if scalar(@open) == 1; diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi index 7da7beff0..a475786dd 100644 --- a/httemplate/misc/process/payment.cgi +++ b/httemplate/misc/process/payment.cgi @@ -219,6 +219,7 @@ if ( $cgi->param('batch') ) { 'paynum_ref' => \$paynum, 'discount_term' => $discount_term, 'no_auto_apply' => ($cgi->param('apply') eq 'never') ? 'Y' : '', + 'no_invnum' => 1, map { $_ => scalar($cgi->param($_)) } @{$payby2fields{$payby}} ); errorpage($error) if $error;