1 <& /elements/header.html, mt($title, @title_arg) &>
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 % unless ( $custnum ) {
9 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
12 <TH CLASS="background" COLSPAN=2 ALIGN="left">
13 <FONT SIZE="+1">Customer search options</FONT>
17 <& /elements/tr-select-agent.html,
18 'curr_value' => scalar( $cgi->param('agentnum') ),
19 'label' => emt('Agent'),
23 <& /elements/tr-select-cust_main-status.html,
24 'label' => 'Customer status',
25 'field' => 'cust_status',
28 <& /elements/tr-select-cust_class.html,
29 label => mt('Customer Class'),
30 field => 'cust_classnum',
32 'pre_options' => [ 0 => emt('(none)') ],
40 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
43 <TH CLASS="background" COLSPAN=2 ALIGN="left">
44 <FONT SIZE="+1">Invoice search options</FONT>
48 <& /elements/tr-input-beginning_ending.html &>
50 <& /elements/tr-input-lessthan_greaterthan.html,
51 label => emt('Charged'),
55 <& /elements/tr-input-lessthan_greaterthan.html,
60 % if ( $conf->exists('cust_bill-enable_promised_date') ) {
63 <TD ALIGN="right" STYLE="vertical-align:text-top">
64 <% emt('Promised payment date:') %></TD>
66 <INPUT TYPE="checkbox" NAME="promised_date" CHECKED VALUE="null">
67 <% emt('None') %> <BR>
68 <INPUT TYPE="checkbox" NAME="promised_date" CHECKED VALUE="past">
69 <% emt('In the past') %><BR>
70 <INPUT TYPE="checkbox" NAME="promised_date" CHECKED VALUE="future">
71 <% emt('In the future') %><BR>
79 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
82 <TH CLASS="background" COLSPAN=2 ALIGN="left">
83 <FONT SIZE="+1">Display options</FONT>
89 <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="open" VALUE="1" CHECKED></TD>
90 <TD><% mt('Show only open invoices') |h %></TD>
94 <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="invoiced" VALUE="1"></TD>
95 <TD><% emt('Exclude discounts from gross amount billed'), %></TD>
98 % unless ( $custnum ) {
100 <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="newest_percust" VALUE="1"></TD>
101 <TD><% mt('Show only the single most recent invoice per-customer') |h %></TD>
108 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
112 <& /elements/footer.html &>
116 unless $FS::CurrentUser::CurrentUser->access_right('List invoices');
118 my $conf = new FS::Conf;
120 my $title = 'Invoice Report';
121 #false laziness w/report_cust_pkg.html
126 if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
128 $cust_main = qsearchs({
129 'table' => 'cust_main',
130 'hashref' => { 'custnum' => $custnum },
131 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
132 }) or die "unknown custnum $custnum";
134 push @title_arg, $cust_main->name;