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 <FONT CLASS="fsinnerbox-title"><% emt('Customer search options') %></FONT>
10 <TABLE CLASS="fsinnerbox">
12 <& /elements/tr-select-agent.html,
13 'curr_value' => scalar( $cgi->param('agentnum') ),
14 'label' => emt('Agent'),
18 <& /elements/tr-select-cust_main-status.html,
19 'label' => 'Customer status',
20 'field' => 'cust_status',
23 <& /elements/tr-select-cust_class.html,
24 label => mt('Customer Class'),
25 field => 'cust_classnum',
27 'pre_options' => [ 0 => emt('(none)') ],
35 <FONT CLASS="fsinnerbox-title"><% emt('Invoice search options') %></FONT>
36 <TABLE CLASS="fsinnerbox">
38 <& /elements/tr-input-beginning_ending.html &>
40 <& /elements/tr-input-lessthan_greaterthan.html,
41 label => emt('Charged'),
45 <& /elements/tr-input-lessthan_greaterthan.html,
50 % if ( $conf->exists('cust_bill-enable_promised_date') ) {
53 <TD ALIGN="right" STYLE="vertical-align:text-top">
54 <% emt('Promised payment date:') %></TD>
56 <INPUT TYPE="checkbox" NAME="promised_date" CHECKED VALUE="null">
57 <% emt('None') %> <BR>
58 <INPUT TYPE="checkbox" NAME="promised_date" CHECKED VALUE="past">
59 <% emt('In the past') %><BR>
60 <INPUT TYPE="checkbox" NAME="promised_date" CHECKED VALUE="future">
61 <% emt('In the future') %><BR>
69 <FONT CLASS="fsinnerbox-title"><% emt('Display options') %></FONT>
70 <TABLE CLASS="fsinnerbox">
73 <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="open" VALUE="1" CHECKED></TD>
74 <TD><% mt('Show only open invoices') |h %></TD>
78 <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="invoiced" VALUE="1"></TD>
79 <TD><% emt('Exclude discounts from gross amount billed'), %></TD>
82 % unless ( $custnum ) {
84 <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="newest_percust" VALUE="1"></TD>
85 <TD><% mt('Show only the single most recent invoice per-customer') |h %></TD>
92 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
96 <& /elements/footer.html &>
100 unless $FS::CurrentUser::CurrentUser->access_right('List invoices');
102 my $conf = new FS::Conf;
104 my $title = 'Invoice Report';
105 #false laziness w/report_cust_pkg.html
110 if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
112 $cust_main = qsearchs({
113 'table' => 'cust_main',
114 'hashref' => { 'custnum' => $custnum },
115 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
116 }) or die "unknown custnum $custnum";
118 push @title_arg, $cust_main->name;