-<TABLE>
- <% include( '/elements/tr-select-agent.html',
- ($cgi->param('agentnum') || ''),
- 'label' => 'Invoices for agent: ',
- )
- %>
- <% include( '/elements/tr-input-beginning_ending.html' ) %>
+% unless ( $custnum ) {
+
+ <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
+
+ <TR>
+ <TH CLASS="background" COLSPAN=2 ALIGN="left">
+ <FONT SIZE="+1">Customer search options</FONT>
+ </TH>
+ </TR>
+
+ <& /elements/tr-select-agent.html,
+ 'curr_value' => scalar( $cgi->param('agentnum') ),
+ 'label' => emt('Agent'),
+ 'disable_empty' => 0,
+ &>
+
+ <& /elements/tr-select-cust_main-status.html,
+ 'label' => 'Customer status',
+ 'field' => 'cust_status',
+ &>
+
+ <& /elements/tr-select-cust_class.html,
+ label => mt('Customer Class'),
+ field => 'cust_classnum',
+ multiple => 1,
+ 'pre_options' => [ 0 => emt('(none)') ],
+ &>
+
+ </TABLE>
+ <BR>
+
+% }
+
+ <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
+
+ <TR>
+ <TH CLASS="background" COLSPAN=2 ALIGN="left">
+ <FONT SIZE="+1">Invoice search options</FONT>
+ </TH>
+ </TR>
+
+ <& /elements/tr-input-beginning_ending.html &>
+
+ <& /elements/tr-input-lessthan_greaterthan.html,
+ label => emt('Charged'),
+ field => 'charged',
+ &>
+
+ <& /elements/tr-input-lessthan_greaterthan.html,
+ label => emt('Owed'),
+ field => 'owed',
+ &>
+
+% if ( $conf->exists('cust_bill-enable_promised_date') ) {