invoice voiding, RT#18677
[freeside.git] / httemplate / view / cust_main / payment_history / voided_invoice.html
1 <DEL><% $link %><% $invoice %><% $link ? '</A>' : '' %></DEL>
2 <I><% mt("voided [_1]", 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 $conf = new FS::Conf;
15
16 my $curuser = $FS::CurrentUser::CurrentUser;
17
18 my $invoice = emt("Invoice #[_1] (Balance [_2])",$cust_bill_void->display_invnum, $cust_bill_void->charged);
19
20 my $under = '';
21
22 my $invnum = $cust_bill_void->invnum;
23
24 #XXX use cust_bill.cgi or?
25 my $link = $curuser->access_right('View invoices')
26              ? qq!<A HREF="${p}view/cust_bill.cgi?$invnum">!
27              : '';
28
29 my $unvoid = ''; #XXX unvoid
30
31 my $delete = '';
32 $delete = areyousure_link("${p}misc/delete-cust_bill.html?$invnum",
33                             emt('Are you sure you want to delete this invoice?'),
34                             emt('Delete this invoice from the database completely'),
35                             emt('delete')
36                         )
37     if ( $opt{'deleteinvoices'} && $curuser->access_right('Delete invoices') );
38
39 my $events = '';
40 #1.9
41 if ( $cust_bill_void->num_cust_event
42      && (    $curuser->access_right('Billing event reports')
43           || $curuser->access_right('View customer billing events')
44         )
45    ) {
46   $under .=
47     qq!<BR><A HREF="${p}search/cust_event.html?invnum=$invnum">( !.
48       emt('View invoice events').' )</A>';
49 }
50 $under = '<FONT SIZE="-1">'.$under.'</FONT>' if length($under);
51
52 </%init>