refactor payment history slightly, add refund receipts, have "unapplied" refunds...
[freeside.git] / httemplate / view / cust_main / payment_history / invoice.html
1 <% $link %><% $pre %>Invoice #<% $invnum %>
2 (Balance $ <% $cust_bill->owed %>)<% $post %><% $link ? '</A>' : '' %><% $events %>
3 <%init>
4
5 my( $cust_bill, %opt ) = @_;
6
7 my $curuser = $FS::CurrentUser::CurrentUser;
8
9 my($pre, $post) = ('', '');
10 if ( $cust_bill->owed > 0 ) {
11   $pre = '<B><FONT SIZE="+1" COLOR="#FF0000">Open ';
12   $post = '</FONT></B>';
13 }
14
15 my $invnum = $cust_bill->invnum;
16
17 my $link = $curuser->access_right('View invoices')
18              ? qq!<A HREF="${p}view/cust_bill.cgi?$invnum">!
19              : '';
20
21 my $events = '';
22 #1.9
23 if ( $cust_bill->num_cust_event
24      && (    $curuser->access_right('Billing event reports')
25           || $curuser->access_right('View customer billing events')
26         )
27    ) {
28   $events =
29     qq!<BR><FONT SIZE="-1"><A HREF="${p}search/cust_event.html?invnum=!.
30     $cust_bill->invnum. '">(&nbsp;View invoice events&nbsp;)</A></FONT>';
31 }
32 #
33
34 </%init>