From a90d069b1f1d814a91bf7cb3eb0d7ac9fdec7e08 Mon Sep 17 00:00:00 2001 From: Christopher Burger Date: Mon, 9 Jul 2018 08:27:53 -0400 Subject: RT# 74435 - Fixed error with refund link on payment history page not allowing batch refund when batch payment was made. Conflicts: FS/FS/cust_main/Billing_Realtime.pm httemplate/view/cust_main/menu.html --- httemplate/edit/cust_refund.cgi | 72 +++++++++++------------------------------ 1 file changed, 18 insertions(+), 54 deletions(-) (limited to 'httemplate/edit/cust_refund.cgi') diff --git a/httemplate/edit/cust_refund.cgi b/httemplate/edit/cust_refund.cgi index 473648f42..55f06642b 100755 --- a/httemplate/edit/cust_refund.cgi +++ b/httemplate/edit/cust_refund.cgi @@ -104,63 +104,25 @@ % } -% 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'); -% } 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)', -&> - - -

-

-> - - -<& /elements/cust_payby_new.html, - 'cust_payby' => \@cust_payby, - 'curr_value' => $custpaybynum, -&> - -
-
+% 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 { +% } else { - % } -

- <& /elements/tr-select-reason.html, 'field' => 'reasonnum', 'reason_class' => 'F', @@ -193,16 +155,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; -- cgit v1.2.1