5 my($query) = $cgi->keywords;
9 my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
10 die "Invoice #$invnum not found!" unless $cust_bill;
11 my $custnum = $cust_bill->getfield('custnum');
13 #my $printed = $cust_bill->printed;
15 print header('Invoice View', menubar(
17 "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
20 print qq!<A HREF="${p}edit/cust_pay.cgi?$invnum">Enter payments (check/cash) against this invoice</A> | !
21 if $cust_bill->owed > 0;
23 print qq!<A HREF="${p}misc/print-invoice.cgi?$invnum">Reprint this invoice</A>!. '<BR><BR>';
25 #false laziness with search/cust_bill_event.cgi
27 print table(). '<TR><TH>Event</TH><TH>Date</TH><TH>Status</TH></TR>';
28 foreach my $cust_bill_event (
29 sort { $a->_date <=> $b->_date } $cust_bill->cust_bill_event
31 my $status = $cust_bill_event->status;
32 $status .= ': '. $cust_bill_event->statustext if $cust_bill_event->statustext;
33 print '<TR><TD>'. $cust_bill_event->part_bill_event->event. '</TD><TD>'.
34 time2str("%a %b %e %T %Y", $cust_bill_event->_date). '</TD><TD>'.
35 $status. '</TD></TR>';
37 print '</TABLE><BR><PRE>';
39 print $cust_bill->print_text;