1 <% $link %><% $invoice %><% $link ? '</A>' : '' %><% $delete %><% $under %>
4 my( $cust_bill, %opt ) = @_;
6 my $conf = new FS::Conf;
8 my $curuser = $FS::CurrentUser::CurrentUser;
10 my $invoice = emt("Invoice #[_1] (Balance [_2])",$cust_bill->display_invnum,$cust_bill->owed);
13 if ( $cust_bill->owed > 0 ) {
14 $invoice = '<B><FONT SIZE="+1" COLOR="#FF0000">' .
15 emt("Open Invoice #[_1] (Balance [_2])",$cust_bill->display_invnum,$cust_bill->owed) .
17 if ( $cust_bill->promised_date ) {
18 $under .= '<BR>'. emt('Payment promised on [_1]',
19 time2str($opt{'date_format'}, $cust_bill->promised_date));
21 } #if $cust_bill->owed
23 my $invnum = $cust_bill->invnum;
25 my $link = $curuser->access_right('View invoices')
26 ? qq!<A HREF="${p}view/cust_bill.cgi?$invnum">!
30 $delete = areyousure_link("${p}misc/delete-cust_bill.html?$invnum",
31 emt('Are you sure you want to delete this invoice?'),
32 emt('Delete this invoice from the database completely'),
35 if ( $opt{'deleteinvoices'} && $curuser->access_right('Delete invoices') );
39 if ( $cust_bill->num_cust_event
40 && ( $curuser->access_right('Billing event reports')
41 || $curuser->access_right('View customer billing events')
45 qq!<BR><A HREF="${p}search/cust_event.html?invnum=$invnum">( !.
46 emt('View invoice events').' )</A>';
48 $under = '<FONT SIZE="-1">'.$under.'</FONT>' if length($under);