ea61f8446b1f0ddb40ef74a4de4a4f4d6cd740e8
[freeside.git] / httemplate / view / cust_main / payment_history / voided_invoice.html
1 <DEL><% $link %><% $invoice %><% $link ? '</A>' : '' %></DEL>
2 <I>voided 
3 % my $void_user = $cust_bill_void->void_access_user;
4 % if ($void_user) {
5     by <% $void_user->username %>
6 % }
7 % my $reason = $cust_bill_void->reason;
8 % if ($reason) {
9      (<% $reason %>)
10 % }
11 <% mt("on [_1]", time2str($date_format, $cust_bill_void->void_date) ) |h %> 
12 </I>
13 <% "$unvoid$under" %>
14 <%init>
15
16 my( $cust_bill_void, %opt ) = @_;
17
18 my $date_format = $opt{'date_format'} || '%m/%d/%Y';
19
20 my $invoice = emt("Invoice #[_1] (Balance [_2])",$cust_bill_void->display_invnum, $cust_bill_void->charged);
21
22 my $under = '';
23
24 my $invnum = $cust_bill_void->invnum;
25
26 my $link = $opt{'View invoices'}
27              ? qq!<A HREF="${p}view/cust_bill_void.html?$invnum">!
28              : '';
29
30 my $unvoid = '';
31 $unvoid = areyousure_link("${p}misc/unvoid-cust_bill_void.html?invnum=". $cust_bill_void->invnum,
32                             emt('Are you sure you want to unvoid this invoice?'),
33                             emt('Unvoid this invoice'),
34                             emt('unvoid')
35                          )
36   if $cust_bill_void->closed !~ /^Y/ && $opt{'Unvoid invoices'};
37
38 my $events = '';
39 if ( $cust_bill_void->num_cust_event
40      && ($opt{'Billing event reports'} || $opt{'View customer billing events'})
41    )
42 {
43   $under .=
44     qq!<BR><A HREF="${p}search/cust_event.html?invnum=$invnum">( !.
45       emt('View invoice events').' )</A>';
46 }
47 $under = '<FONT SIZE="-1">'.$under.'</FONT>' if length($under);
48
49 </%init>