diff options
| author | Christopher Burger <burgerc@freeside.biz> | 2018-11-07 11:32:05 -0500 |
|---|---|---|
| committer | Christopher Burger <burgerc@freeside.biz> | 2018-11-07 13:14:01 -0500 |
| commit | eadb3075ac883f761c959a6dd60a358b40f1e499 (patch) | |
| tree | e744f8f81e08a8a383febe30cb36bd8e4993d686 /httemplate/edit/cust_refund.cgi | |
| parent | ab42a6d76c5a5905d223d214e409f0527b2c5b9e (diff) | |
RT# 74435 - fixed so payment would auto unapply when doing a batch refund
Conflicts:
httemplate/edit/process/cust_refund.cgi
Diffstat (limited to 'httemplate/edit/cust_refund.cgi')
| -rwxr-xr-x | httemplate/edit/cust_refund.cgi | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/httemplate/edit/cust_refund.cgi b/httemplate/edit/cust_refund.cgi index c79c39a80..39584c8eb 100755 --- a/httemplate/edit/cust_refund.cgi +++ b/httemplate/edit/cust_refund.cgi @@ -46,6 +46,7 @@ <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 @@ -159,7 +160,7 @@ my $batch = $cgi->param('batch'); die "access denied" unless $FS::CurrentUser::CurrentUser->refund_access_right($payby); -my( $paynum, $cust_pay, $batchnum ) = ( '', '', '' ); +my( $paynum, $cust_pay, $batchnum, $cust_payby ) = ( '', '', '', '' ); if ( $cgi->param('paynum') =~ /^(\d+)$/ ) { $paynum = $1; $cust_pay = qsearchs('cust_pay', { paynum=>$paynum } ) @@ -172,6 +173,12 @@ 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; |
