optimize customer view (esp. with lots of commission credits), RT#26416
[freeside.git] / httemplate / view / cust_main / payment_history / voided_payment.html
index 88b5e0a..a8194a7 100644 (file)
@@ -11,8 +11,6 @@ my( $cust_pay_void, %opt ) = @_;
 
 my $date_format = $opt{'date_format'} || '%m/%d/%Y';
 
-my $curuser = $FS::CurrentUser::CurrentUser;
-
 my ($payby,$payinfo) = translate_payinfo($cust_pay_void);
 $payby = translate_payby($payby,$payinfo);
 my $info = $payby ? "($payby$payinfo)" : '';
@@ -31,6 +29,6 @@ $unvoid = areyousure_link("${p}misc/unvoid-cust_pay_void.cgi?".$cust_pay_void->p
                             emt('Unvoid this payment from the database') . $unvoidmsg,
                             emt('unvoid')
                          )
-    if ( $cust_pay_void->closed !~ /^Y/i && $curuser->access_right('Unvoid payments') );
+  if $cust_pay_void->closed !~ /^Y/i && $opt{'Unvoid payments'};
 
 </%init>