X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_refund.cgi;h=39584c8eb90a1b5ce0d1fa8964796f24f64430cb;hb=eadb3075ac883f761c959a6dd60a358b40f1e499;hp=bfcbfe725dae9cb05d49235e38bbc13c179f091e;hpb=b3db3e68f602f3ca395a6bc272a4de6fef2d0895;p=freeside.git diff --git a/httemplate/edit/cust_refund.cgi b/httemplate/edit/cust_refund.cgi index bfcbfe725..39584c8eb 100755 --- a/httemplate/edit/cust_refund.cgi +++ b/httemplate/edit/cust_refund.cgi @@ -10,7 +10,7 @@ <% small_custview($custnum, $conf->config('countrydefault')) %> % } -
+ @@ -46,6 +46,7 @@ Method<% $payby %> # <% $paymask %> + % unless ( $paydate || $cust_pay->payby ne 'CARD' ) { # possibly other reasons: i.e. card has since expired @@ -102,6 +103,22 @@ Check # +% } +% 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 { % } @@ -116,7 +133,7 @@
- +
@@ -138,22 +155,30 @@ 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, $cust_payby ) = ( '', '', '', '' ); 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; } 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;