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