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)') ],
36 <INPUT TYPE="hidden" NAME="payby" VALUE="<% $cust_main->payby %>">
38 <& /elements/tr-select-payby.html,
39 label => emt('Payment method:'),
51 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
54 <TH CLASS="background" COLSPAN=2 ALIGN="left">
55 <FONT SIZE="+1">Invoice search options</FONT>
59 <& /elements/tr-input-beginning_ending.html &>
61 <& /elements/tr-input-lessthan_greaterthan.html,
62 label => emt('Charged'),
66 <& /elements/tr-input-lessthan_greaterthan.html,
71 % if ( $conf->exists('cust_bill-enable_promised_date') ) {
74 <TD ALIGN="right" STYLE="vertical-align:text-top">
75 <% emt('Promised payment date:') %></TD>
77 <INPUT TYPE="checkbox" NAME="promised_date" CHECKED VALUE="null">
78 <% emt('None') %> <BR>
79 <INPUT TYPE="checkbox" NAME="promised_date" CHECKED VALUE="past">
80 <% emt('In the past') %><BR>
81 <INPUT TYPE="checkbox" NAME="promised_date" CHECKED VALUE="future">
82 <% emt('In the future') %><BR>
90 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
93 <TH CLASS="background" COLSPAN=2 ALIGN="left">
94 <FONT SIZE="+1">Display options</FONT>
100 <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="open" VALUE="1" CHECKED></TD>
101 <TD><% mt('Show only open invoices') |h %></TD>
105 <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="invoiced" VALUE="1" CHECKED></TD>
106 <TD><% emt('Exclude discounts from gross amount billed'), %></TD>
109 % unless ( $custnum ) {
111 <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="newest_percust" VALUE="1"></TD>
112 <TD><% mt('Show only the single most recent invoice per-customer') |h %></TD>
119 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
123 <& /elements/footer.html &>
127 unless $FS::CurrentUser::CurrentUser->access_right('List invoices');
129 my $conf = new FS::Conf;
131 my $title = 'Invoice Report';
132 #false laziness w/report_cust_pkg.html
137 if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
139 $cust_main = qsearchs({
140 'table' => 'cust_main',
141 'hashref' => { 'custnum' => $custnum },
142 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
143 }) or die "unknown custnum $custnum";
145 push @title_arg, $cust_main->name;