This commit was generated by cvs2svn to compensate for changes in r8690,
[freeside.git] / httemplate / view / cust_main / payment_history / invoice.html
1 <% $link %><% $pre %>Invoice #<% $cust_bill->display_invnum %>
2 (Balance $ <% $cust_bill->owed %>)<% $post %><% $link ? '</A>' : '' %><% $delete %><% $events %>
3 <%init>
4
5 my( $cust_bill, %opt ) = @_;
6
7 my $conf = new FS::Conf;
8
9 my $curuser = $FS::CurrentUser::CurrentUser;
10
11 my($pre, $post) = ('', '');
12 if ( $cust_bill->owed > 0 ) {
13   $pre = '<B><FONT SIZE="+1" COLOR="#FF0000">Open ';
14   $post = '</FONT></B>';
15 }
16
17 my $invnum = $cust_bill->invnum;
18
19 my $link = $curuser->access_right('View invoices')
20              ? qq!<A HREF="${p}view/cust_bill.cgi?$invnum">!
21              : '';
22
23 my $delete = '';
24 if ( $opt{'deleteinvoices'} && $curuser->access_right('Delete invoices') ) {
25   $delete = qq! (<A HREF="javascript:areyousure('!.
26             qq!${p}misc/delete-cust_bill.html?$invnum',!.
27             qq!'Are you sure you want to delete this invoice?')"!.
28             qq! TITLE="Delete this invoice from the database completely"!.
29             qq!>delete</A>)!;
30 }
31
32 my $events = '';
33 #1.9
34 if ( $cust_bill->num_cust_event
35      && (    $curuser->access_right('Billing event reports')
36           || $curuser->access_right('View customer billing events')
37         )
38    ) {
39   $events =
40     qq!<BR><FONT SIZE="-1"><A HREF="${p}search/cust_event.html?invnum=$invnum!.
41     '">(&nbsp;View invoice events&nbsp;)</A></FONT>';
42 }
43 #
44
45 </%init>