1 <% include('/elements/header.html', $title ) %>
3 <FORM ACTION="cust_bill.html" METHOD="GET">
4 <INPUT TYPE="hidden" NAME="magic" VALUE="_date">
5 <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
7 <TABLE BGCOLOR="#cccccc" CELLSPACING=0
9 % unless ( $custnum ) {
10 <% include( '/elements/tr-select-agent.html',
11 'curr_value' => scalar( $cgi->param('agentnum') ),
12 'label' => 'Invoices for agent: ',
18 <% include( '/elements/tr-input-beginning_ending.html' ) %>
20 <% include( '/elements/tr-input-lessthan_greaterthan.html',
26 <% include( '/elements/tr-input-lessthan_greaterthan.html',
33 <INPUT TYPE="hidden" NAME="payby" VALUE="<% $cust_main->payby %>">
35 <% include( '/elements/tr-select-payby.html',
36 label => 'Payment method:',
45 <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="open" VALUE="1" CHECKED></TD>
46 <TD>Show only open invoices</TD>
49 % unless ( $custnum ) {
51 <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="newest_percust" VALUE="1"></TD>
52 <TD>Show only the single most recent invoice per-customer</TD>
59 <INPUT TYPE="submit" VALUE="Get Report">
63 <% include('/elements/footer.html') %>
67 unless $FS::CurrentUser::CurrentUser->access_right('List invoices');
69 my $title = 'Invoice Report';
71 #false laziness w/report_cust_pkg.html
74 if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
76 $cust_main = qsearchs({
77 'table' => 'cust_main',
78 'hashref' => { 'custnum' => $custnum },
79 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
80 }) or die "unknown custnum $custnum";
81 $title .= ': '. $cust_main->name;