X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_refund.cgi;h=c79c39a80914d5e1367d0f38e5e2c19885291472;hb=057ae504915d912bc60df87c9914e11752edf680;hp=e1975ed70ce8188556619f915121a457ac728991;hpb=639e88d37ab33deeea4db7c8d1f15e8967f1826f;p=freeside.git diff --git a/httemplate/edit/cust_refund.cgi b/httemplate/edit/cust_refund.cgi index e1975ed70..c79c39a80 100755 --- a/httemplate/edit/cust_refund.cgi +++ b/httemplate/edit/cust_refund.cgi @@ -103,27 +103,22 @@ % } -% elsif ($payby eq 'CHEK') { -% -% my @cust_payby = (); -% if ( $payby eq 'CARD' ) { -% @cust_payby = $cust_main->cust_payby('CARD','DCRD'); -% } elsif ( $payby eq 'CHEK' ) { -% @cust_payby = $cust_main->cust_payby('CHEK','DCHK'); +% elsif ($payby eq 'CHEK' || $payby eq 'CARD') { + +% if ( $conf->exists("batch-enable") +% || grep $payby eq $_, $conf->config('batch-enable_payby') +% ) { +% if ( grep $payby eq $_, $conf->config('realtime-disable_payby') ) { + +% } else { + + > +    <% mt('Add to current batch') |h %> + +% } +% } + % } else { -% die "unknown payby $payby"; -% } -% -% my $custpaybynum = length(scalar($cgi->param('custpaybynum'))) -% ? scalar($cgi->param('custpaybynum')) -% : scalar(@cust_payby) && $cust_payby[0]->custpaybynum; -<& /elements/tr-select-cust_payby.html, - 'cust_payby' => \@cust_payby, - 'curr_value' => $custpaybynum, - 'onchange' => 'cust_payby_changed(this)', -&> - -% } else { % } @@ -159,16 +154,18 @@ my $payby = $cgi->param('payby'); my $payinfo = $cgi->param('payinfo'); my $reason = $cgi->param('reason'); my $link = $cgi->param('popup') ? 'popup' : ''; +my $batch = $cgi->param('batch'); die "access denied" unless $FS::CurrentUser::CurrentUser->refund_access_right($payby); -my( $paynum, $cust_pay ) = ( '', '' ); +my( $paynum, $cust_pay, $batchnum ) = ( '', '', '' ); if ( $cgi->param('paynum') =~ /^(\d+)$/ ) { $paynum = $1; $cust_pay = qsearchs('cust_pay', { paynum=>$paynum } ) or die "unknown payment # $paynum"; $refund ||= $cust_pay->unrefunded; + $batchnum = $cust_pay->batchnum; if ( $custnum ) { die "payment # $paynum is not for specified customer # $custnum" unless $custnum == $cust_pay->custnum; @@ -178,9 +175,6 @@ if ( $cgi->param('paynum') =~ /^(\d+)$/ ) { } die "no custnum or paynum specified!" unless $custnum; -my $cust_main = qsearchs( 'cust_main', { 'custnum'=>$custnum } ); -die "unknown custnum $custnum" unless $cust_main; - my $_date = time; my $p1 = popurl(1);