From: Christopher Burger Date: Thu, 8 Nov 2018 13:48:24 +0000 (-0500) Subject: RT# 74453 - V3 fixes for backport X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=28fd597fb26a3e4064e63f0cf9a23e06a273fb6e RT# 74453 - V3 fixes for backport --- diff --git a/httemplate/edit/cust_refund.cgi b/httemplate/edit/cust_refund.cgi index 39584c8eb..c79c39a80 100755 --- a/httemplate/edit/cust_refund.cgi +++ b/httemplate/edit/cust_refund.cgi @@ -46,7 +46,6 @@ Method<% $payby %> # <% $paymask %> - % unless ( $paydate || $cust_pay->payby ne 'CARD' ) { # possibly other reasons: i.e. card has since expired @@ -160,7 +159,7 @@ my $batch = $cgi->param('batch'); die "access denied" unless $FS::CurrentUser::CurrentUser->refund_access_right($payby); -my( $paynum, $cust_pay, $batchnum, $cust_payby ) = ( '', '', '', '' ); +my( $paynum, $cust_pay, $batchnum ) = ( '', '', '' ); if ( $cgi->param('paynum') =~ /^(\d+)$/ ) { $paynum = $1; $cust_pay = qsearchs('cust_pay', { paynum=>$paynum } ) @@ -173,12 +172,6 @@ if ( $cgi->param('paynum') =~ /^(\d+)$/ ) { } else { $custnum = $cust_pay->custnum; } - # get custpayby - die "Can not find payby record!" - unless $cust_payby = qsearchs( - 'cust_payby', { paymask => $cust_pay->paymask, custnum => $custnum } - ); - } die "no custnum or paynum specified!" unless $custnum; diff --git a/httemplate/edit/process/cust_refund.cgi b/httemplate/edit/process/cust_refund.cgi index 2b5f308c1..2b6f9cd52 100755 --- a/httemplate/edit/process/cust_refund.cgi +++ b/httemplate/edit/process/cust_refund.cgi @@ -21,6 +21,8 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Refund payment') || $FS::CurrentUser::CurrentUser->access_right('Post refund'); +my $conf = new FS::Conf; + $cgi->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!"; my $custnum = $1; my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ) @@ -64,25 +66,7 @@ if ( $cgi->param('paynum') > 0) { }); } -if ( (my $custpaybynum = scalar($cgi->param('custpaybynum'))) > 0 ) { - - ## - # use stored cust_payby info - ## - - $cust_payby = qsearchs('cust_payby', { custnum => $custnum, - custpaybynum => $custpaybynum, } ) - or die "unknown custpaybynum $custpaybynum"; - - # not needed for realtime_bop, but still needed for batch_card - $payinfo = $cust_payby->payinfo; - $paymask = $cust_payby->paymask; - $paycvv = $cust_payby->paycvv; # pass it if we got it, running a transaction will clear it - ( $month, $year ) = $cust_payby->paydate_mon_year; - $payname = $cust_payby->payname; - $cgi->param(-name=>"paytype", -value=>$cust_payby->paytype) unless $cgi->param("paytype"); - -} elsif ( $cgi->param('paynum') > 0) { +if ( $cgi->param('paynum') > 0) { $payinfo = $cust_pay->payinfo; $payname = $cust_pay->payname;