X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_refund.cgi;h=4865343750e3ee55e996028a6a03b6e34d78b7dc;hb=76a7bc00ed44a8123a5ceb0b57f7b9ad05ae82c4;hp=59417b4c4806f3cef7c153808072b5dc1f2dbbb3;hpb=06a85a88bfdb0d3fc79ee055eb8327658dfe63ab;p=freeside.git diff --git a/httemplate/edit/cust_refund.cgi b/httemplate/edit/cust_refund.cgi index 59417b4c4..486534375 100755 --- a/httemplate/edit/cust_refund.cgi +++ b/httemplate/edit/cust_refund.cgi @@ -59,33 +59,29 @@ </TD> </TR> % } - -% -% #false laziness w/FS/FS/cust_main::realtime_refund_bop -% if ( $cust_pay->paybatch =~ /^(\w+):(\w+)(:(\w+))?$/ ) { -% my ( $processor, $auth, $order_number ) = ( $1, $2, $4 ); -% - - +% if ( $cust_pay->processor ) { <TR> - <TD ALIGN="right">Processor</TD><TD BGCOLOR="#ffffff"><% $processor %></TD> + <TD ALIGN="right">Processor</TD> + <TD BGCOLOR="#ffffff"><% $cust_pay->processor %></TD> </TR> -% if ( length($auth) ) { +% if ( length($cust_pay->auth) ) { <TR> - <TD ALIGN="right">Authorization</TD><TD BGCOLOR="#ffffff"><% $auth %></TD> + <TD ALIGN="right">Authorization</TD> + <TD BGCOLOR="#ffffff"><% $cust_pay->auth %></TD> </TR> % } -% if ( length($order_number) ) { +% if ( length($cust_pay->order_number) ) { <TR> - <TD ALIGN="right">Order number</TD><TD BGCOLOR="#ffffff"><% $order_number %></TD> + <TD ALIGN="right">Order number</TD> + <TD BGCOLOR="#ffffff"><% $cust_pay->order_number %></TD> </TR> % } -% } +% } # if ($cust_pay->processor) </TABLE> -% } +% } #if $cust_pay <BR>Refund @@ -98,7 +94,7 @@ <TR> <TD ALIGN="right">Amount</TD> - <TD BGCOLOR="#ffffff">$<INPUT TYPE="text" NAME="refund" VALUE="<% $refund %>" SIZE=8 MAXLENGTH=8> by <B><% FS::payby->payname($payby) %></B></TD> + <TD BGCOLOR="#ffffff">$<INPUT TYPE="text" NAME="refund" VALUE="<% $refund %>" SIZE=8 MAXLENGTH=9> by <B><% FS::payby->payname($payby) %></B></TD> </TR> % if ( $payby eq 'BILL' ) { @@ -130,9 +126,6 @@ <%init> -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Refund payment'); - my $conf = new FS::Conf; my $date_format = $conf->config('date_format') || '%m/%d/%Y'; @@ -143,6 +136,17 @@ my $payinfo = $cgi->param('payinfo'); my $reason = $cgi->param('reason'); my $link = $cgi->param('popup') ? 'popup' : ''; +my @rights = (); +push @rights, 'Post refund' if $payby =~ /^(BILL|CASH|MCRD|MCHK)$/; +push @rights, 'Post check refund' if $payby eq 'BILL'; +push @rights, 'Post cash refund ' if $payby eq 'CASH'; +push @rights, 'Refund payment' if $payby =~ /^(CARD|CHEK)$/; +push @rights, 'Refund credit card payment' if $payby eq 'CARD'; +push @rights, 'Refund Echeck payment' if $payby eq 'CHEK'; + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right(\@rights); + my( $paynum, $cust_pay ) = ( '', '' ); if ( $cgi->param('paynum') =~ /^(\d+)$/ ) { $paynum = $1;