RT# 74453 - V3 fixes for backport
authorChristopher Burger <burgerc@freeside.biz>
Thu, 8 Nov 2018 13:48:24 +0000 (08:48 -0500)
committerChristopher Burger <burgerc@freeside.biz>
Thu, 8 Nov 2018 13:48:24 +0000 (08:48 -0500)
httemplate/edit/cust_refund.cgi
httemplate/edit/process/cust_refund.cgi

index 39584c8..c79c39a 100755 (executable)
@@ -46,7 +46,6 @@
 
   <TR>
     <TD ALIGN="right">Method</TD><TD BGCOLOR="#ffffff"><% $payby %> # <% $paymask %></TD>
-    <INPUT TYPE="hidden" NAME="custpaybynum" VALUE="<% $cust_payby->custpaybynum %>">
   </TR>
 
 % 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;
 
index 2b5f308..2b6f9cd 100755 (executable)
@@ -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;