putting the C in ACL
[freeside.git] / httemplate / view / cust_main / payment_history.html
index 4f46ace..43c55e8 100644 (file)
@@ -18,6 +18,7 @@
 
 % if ( ( $payby{'CARD'} || $payby{'DCRD'} )
 %        && $curuser->access_right('Process payment')
+%        && ! $cust_main->is_encrypted($cust_main->payinfo)
 %      ) {
   <% $s++ ? ' | ' : '' %>
   <A HREF="<% $p %>misc/payment.cgi?payby=CARD;custnum=<% $custnum %>">Process credit card payment</A>
@@ -25,6 +26,7 @@
 
 % if ( ( $payby{'CHEK'} || $payby{'DCHK'} )
 %        && $curuser->access_right('Process payment')
+%        && ! $cust_main->is_encrypted($cust_main->payinfo)
 %      ) {
   <% $s++ ? ' | ' : '' %>
   <A HREF="<% $p %>misc/payment.cgi?payby=CHEK;custnum=<% $custnum %>">Process electronic check (ACH) payment</A>
@@ -76,7 +78,7 @@
 %
 %  my $payinfo;
 %  if ( $payby eq 'CARD' ) {
-%    $payinfo = $cust_pay->payinfo_masked;
+%    $payinfo = $cust_pay->paymask;
 %  } elsif ( $payby eq 'CHEK' && $cust_pay->payinfo =~ /^(\d+)\@(\d+)$/ ) {
 %    $payinfo = "ABA $2, Acct# $1";
 %  } else {
 %
 %  my $payby = $cust_pay_void->payby;
 %  my $payinfo = $payby eq 'CARD'
-%                  ? $cust_pay_void->payinfo_masked
+%                  ? $cust_pay_void->paymask
 %                  : $cust_pay_void->payinfo;
 %
 %  $payby =~ s/^BILL$/Check #/ if $payinfo;
 %
 %  my $payby = $cust_refund->payby;
 %  my $payinfo = $payby eq 'CARD'
-%                  ? $cust_refund->payinfo_masked
+%                  ? $cust_refund->paymask
 %                  : $cust_refund->payinfo;
 %
 %  $payby =~ s/^BILL$/Check #/ if $payinfo;
 %  $payby =~ s/^CHEK$/Electronic check /;
 %  $payby =~ s/^(CARD|COMP)$/$1 /;
 %
+%  my $delete = '';
+%  if ( $cust_refund->closed !~ /^Y/i
+%       && $conf->exists('deleterefunds')
+%       && $curuser->access_right('Delete refund')
+%     )
+%  {
+%    $delete = qq! (<A HREF="javascript:areyousure('!.
+%              qq!${p}misc/delete-cust_refund.cgi?!. $cust_refund->refundnum.
+%              qq!', 'Are you sure you want to delete this refund?')"!.
+%              qq! TITLE="Delete this refund from the database completely - not recommended"!.
+%              qq!>delete</A>)!;
+%  }
+%
 %  push @history, {
 %    'date'   => $cust_refund->_date,
-%    'desc'   => "Refund ($payby$payinfo) by ". $cust_refund->otaker,
+%    'desc'   => "Refund ($payby$payinfo) by ". $cust_refund->otaker. "<BR>".
+%                $delete,
 %    'refund' => $cust_refund->refund,
 %  };
 %