RT #25498 adding reason to voided payments and voided invoices on payment history
[freeside.git] / httemplate / view / cust_main / payment_history / voided_invoice.html
index 15393cb..ba51b3b 100644 (file)
@@ -1,5 +1,5 @@
 <DEL><% $link %><% $invoice %><% $link ? '</A>' : '' %></DEL>
-<I><% mt("voided [_1]", time2str($date_format, $cust_bill_void->void_date) ) |h %> 
+<I><% mt("voided ([_1]) [_2]", $cust_bill_void->reason, time2str($date_format, $cust_bill_void->void_date) ) |h %> 
 % my $void_user = $cust_bill_void->void_access_user;
 % if ($void_user) {
     by <% $void_user->username %></I>
@@ -11,17 +11,13 @@ my( $cust_bill_void, %opt ) = @_;
 
 my $date_format = $opt{'date_format'} || '%m/%d/%Y';
 
-my $conf = new FS::Conf;
-
-my $curuser = $FS::CurrentUser::CurrentUser;
-
 my $invoice = emt("Invoice #[_1] (Balance [_2])",$cust_bill_void->display_invnum, $cust_bill_void->charged);
 
 my $under = '';
 
 my $invnum = $cust_bill_void->invnum;
 
-my $link = $curuser->access_right('View invoices')
+my $link = $opt{'View invoices'}
              ? qq!<A HREF="${p}view/cust_bill_void.html?$invnum">!
              : '';
 
@@ -31,7 +27,7 @@ $unvoid = areyousure_link("${p}misc/unvoid-cust_bill_void.html?invnum=". $cust_b
                             emt('Unvoid this invoice'),
                             emt('unvoid')
                          )
-  if $cust_bill_void->closed !~ /^Y/ && $curuser->access_right('Unvoid invoices');
+  if $cust_bill_void->closed !~ /^Y/ && $opt{'Unvoid invoices'};
 
 my $delete = '';
 $delete = areyousure_link("${p}misc/delete-cust_bill.html?$invnum",
@@ -39,15 +35,13 @@ $delete = areyousure_link("${p}misc/delete-cust_bill.html?$invnum",
                             emt('Delete this invoice from the database completely'),
                             emt('delete')
                         )
-    if ( $opt{'deleteinvoices'} && $curuser->access_right('Delete invoices') );
+    if $opt{'deleteinvoices'} && $opt{'Delete invoices'};
 
 my $events = '';
-#1.9
 if ( $cust_bill_void->num_cust_event
-     && (    $curuser->access_right('Billing event reports')
-          || $curuser->access_right('View customer billing events')
-        )
-   ) {
+     && ($opt{'Billing event reports'} || $opt{'View customer billing events'})
+   )
+{
   $under .=
     qq!<BR><A HREF="${p}search/cust_event.html?invnum=$invnum">( !.
       emt('View invoice events').' )</A>';