-<& /elements/header.html, emt('Customer Report') &>
+<& /elements/header.html, mt('Customer Report') &>
<FORM ACTION="cust_main.html" METHOD="GET">
<INPUT TYPE="hidden" NAME="magic" VALUE="bill">
<TABLE BGCOLOR="#cccccc" CELLSPACING=0>
<TR>
- <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1"><% mt('Search options') |h %></FONT></TH>
+ <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1"><% mt('Basic search options') |h %></FONT></TH>
</TR>
<& /elements/tr-select-agent.html,
'disable_empty' => 0,
&>
+ <& /elements/tr-select-sales.html,
+ 'curr_value' => scalar($cgi->param('salesnum')),
+ 'pre_options' => [ '' => 'all',
+ 0 => '(none)', ],
+ 'disable_empty' => 1,
+ &>
+
<& /elements/tr-select-cust_main-status.html,
'label' => emt('Status'),
&>
'all_selected' => 1,
&>
- <TR>
- <TD ALIGN="right" VALIGN="center"><% mt('Address') |h %></TD>
- <TD><INPUT TYPE="text" NAME="address" SIZE=54></TD>
- </TR>
+ <& /elements/tr-select-part_referral.html,
+ 'label' => emt('Advertising Source'),
+ 'multiple' => 1,
+ #no, causes customers with disabled ones to disappear
+ #'all_selected' => 1,
+ &>
<TR>
<TD ALIGN="right" VALIGN="center"><% mt('Signup date') |h %></TD>
</TD>
</TR>
- <& /elements/tr-select-cust_tag.html,
- 'cgi' => $cgi,
- 'is_report' => 1,
- 'multiple' => 1,
- &>
+% if ( $conf->exists('cust_main-enable_birthdate') ) {
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('Date of Birth') |h %></TD>
+ <TD>
+ <TABLE>
+ <& /elements/tr-input-beginning_ending.html,
+ prefix => 'birthdate',
+ layout => 'horiz',
+ &>
+ </TABLE>
+ </TD>
+ </TR>
+% }
+
+% if ( $conf->exists('cust_main-enable_spouse_birthdate') ) {
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('Spouse Date of Birth') |h %></TD>
+ <TD>
+ <TABLE>
+ <& /elements/tr-input-beginning_ending.html,
+ prefix => 'spouse_birthdate',
+ layout => 'horiz',
+ &>
+ </TABLE>
+ </TD>
+ </TR>
+% }
+
+% if ( $conf->exists('cust_main-enable_anniversary_date') ) {
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('Anniversary Date') |h %></TD>
+ <TD>
+ <TABLE>
+ <& /elements/tr-input-beginning_ending.html,
+ prefix => 'anniversary_date',
+ layout => 'horiz',
+ &>
+ </TABLE>
+ </TD>
+ </TR>
+% }
+
+ <TR>
+ <TD ALIGN="right">Tags</TD>
+ <TD>
+ <& /elements/select-cust_tag.html,
+ 'cgi' => $cgi,
+ 'is_report' => 1,
+ 'multiple' => 1,
+ &>
+ <DIV STYLE="display:inline-block; vertical-align:baseline">
+ <INPUT TYPE="radio" NAME="all_tags" VALUE="0" CHECKED> Any of these
+ <BR>
+ <INPUT TYPE="radio" NAME="all_tags" VALUE="1"> All of these
+ </DIV>
+ </TD>
+ </TR>
+
+ <TR>
+ <TD ALIGN="right">With package of class</TD>
+ <TD>
+ <& /elements/select-pkg_class.html,
+ 'field' => 'pkg_classnum',
+ 'multiple' => 1,
+ &>
+ <DIV STYLE="display:inline-block; vertical-align:baseline">
+ <INPUT TYPE="radio" NAME="all_pkg_classnums" VALUE="0" CHECKED>
+ Any of these
+ <BR>
+ <INPUT TYPE="radio" NAME="all_pkg_classnums" VALUE="1">
+ All of these
+ </DIV>
+ </TD>
+ </TR>
+
+ <TR>
+ <TH CLASS="background" COLSPAN=2> </TH>
+ </TR>
+
+ <TR>
+ <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1"><% mt('Location search options') |h %></FONT></TH>
+ </TR>
+
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('Address') |h %></TD>
+ <TD><INPUT TYPE="text" NAME="address" SIZE=54></TD>
+ </TR>
+
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('City') |h %></TD>
+ <TD>
+ <& /elements/city.html,
+ disable_empty => 0,
+ empty_label => '(all)',
+ disable_text => 1,
+ &>
+ </TD>
+ </TR>
+
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('County') |h %></TD>
+ <TD>
+ <& /elements/select-county.html,
+ disable_empty => 0,
+ empty_label => '(all)',
+ &>
+ </TD>
+ </TR>
+
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('State') |h %></TD>
+ <TD>
+ <& /elements/select-state.html,
+ disable_empty => 0,
+ empty_label => '(all)',
+ &>
+ </TD>
+ </TR>
+
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('Zip') |h %></TD>
+ <TD><INPUT TYPE="text" NAME="zip" SIZE=12></TD>
+ </TR>
+
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('Country') |h %></TD>
+ <TD>
+ <& /elements/select-country.html,
+ disable_empty => 0,
+ state_disable_empty => 0,
+ state_empty_label => '(all)',
+ &>
+ </TD>
+ </TR>
+
+ <TR>
+ <TH CLASS="background" COLSPAN=2> </TH>
+ </TR>
+
+ <TR>
+ <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1"><% mt('Billing search options') |h %></FONT></TH>
+ </TR>
<& /elements/tr-select-payby.html,
'payby_type' => 'cust',
}
}
</SCRIPT>
-
+
+% my @exempt_groups = grep /\S/, $conf->config('tax-cust_exempt-groups');
+% unless ( @exempt_groups ) {
+
+% #falze laziness with With/Without postal mail invoices
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('Tax exempt') |h %></TD>
+ <TD><INPUT TYPE="checkbox" NAME="tax" ID="tax" onClick="tax_changed();"></TD>
+ </TR>
+
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('Not tax exempt') |h %></TD>
+ <TD><INPUT TYPE="checkbox" NAME="no_tax" ID="no_tax" onClick="no_tax_changed();"></TD>
+ </TR>
+
+ <SCRIPT TYPE="text/javascript">
+ function tax_changed() {
+ if ( document.getElementById('tax').checked == true ) {
+ document.getElementById('no_tax').checked = false;
+ }
+ }
+ function no_tax_changed() {
+ if ( document.getElementById('no_tax').checked == true ) {
+ document.getElementById('tax').checked = false;
+ }
+ }
+ </SCRIPT>
+% }
+
<TR>
<TD ALIGN="right"><% mt('Invoice terms') |h %></TD>
<TD>
+% my @agentnums = $FS::CurrentUser::CurrentUser->agentnums;
+% my $agentnum = scalar(@agentnums) == 1 ? $agentnums[0] : '';
<& /elements/select-terms.html,
- 'pre_options' => [ '' => emt('all') ],
- 'empty_value' => 'NULL',
+ 'pre_options' => [ '' => emt('all') ],
+ 'empty_value' => 'NULL',
+ 'agentnum' => $agentnum,
&>
</TD>
</TR>
&>
<TR>
- <TD ALIGN="right" VALIGN="center"><% mt('Include cancelled packages') |h %></TD>
- <TD><INPUT TYPE="checkbox" NAME="cancelled_pkgs"></TD>
+ <TD ALIGN="right" VALIGN="center"><% mt('With invoicing email address(es)') |h %></TD>
+ <TD><INPUT TYPE="checkbox" NAME="with_email"></TD>
</TR>
<TR>
- <TD ALIGN="right" VALIGN="center"><% mt('Without census tract') |h %></TD>
- <TD><INPUT TYPE="checkbox" NAME="no_censustract"></TD>
+ <TD ALIGN="right" VALIGN="center"><% mt('With postal mail invoices') |h %></TD>
+ <TD><INPUT TYPE="checkbox" NAME="POST" ID="POST" onClick="POST_changed();"></TD>
</TR>
-% if ( $conf->exists('enable_taxproducts') ) {
-
- <TR>
- <TD ALIGN="right" VALIGN="center"><% mt('With hardcoded tax location') |h %></TD>
- <TD><INPUT TYPE="checkbox" NAME="with_geocode"></TD>
- </TR>
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('Without postal mail invoices') |h %></TD>
+ <TD><INPUT TYPE="checkbox" NAME="no_POST" ID="no_POST" onClick="no_POST_changed();"></TD>
+ </TR>
-% }
+ <SCRIPT TYPE="text/javascript">
+ function POST_changed() {
+ if ( document.getElementById('POST').checked == true ) {
+ document.getElementById('no_POST').checked = false;
+ }
+ }
+ function no_POST_changed() {
+ if ( document.getElementById('no_POST').checked == true ) {
+ document.getElementById('POST').checked = false;
+ }
+ }
+ </SCRIPT>
<TR>
<TH CLASS="background" COLSPAN=2> </TH>
<TD ALIGN="right" VALIGN="center"><% mt('Add package columns') |h %></TD>
<TD><INPUT TYPE="checkbox" NAME="flattened_pkgs"></TD>
</TR>
+
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('Include cancelled packages') |h %></TD>
+ <TD><INPUT TYPE="checkbox" NAME="cancelled_pkgs"></TD>
+ </TR>
+
</TABLE>
<BR>
<%init>
die "access denied"
- unless ( $FS::CurrentUser::CurrentUser->access_right('List customers') &&
- $FS::CurrentUser::CurrentUser->access_right('List packages')
- );
+ unless $FS::CurrentUser::CurrentUser->access_right('Advanced customer search');
my $conf = new FS::Conf;