1 <& /elements/header.html, mt('Customer Report') &>
3 <FORM ACTION="cust_main.html" METHOD="GET">
4 <INPUT TYPE="hidden" NAME="magic" VALUE="bill">
6 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
9 <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1"><% mt('Basic search options') |h %></FONT></TH>
12 <& /elements/tr-select-agent.html,
13 'curr_value' => scalar($cgi->param('agentnum')),
17 <& /elements/tr-select-sales.html,
18 'curr_value' => scalar($cgi->param('salesnum')),
19 'pre_options' => [ '' => 'all',
24 <& /elements/tr-select-cust_main-status.html,
25 'label' => emt('Status'),
28 <& /elements/tr-select-cust_class.html,
29 'label' => emt('Class'),
31 'pre_options' => [ '' => emt('(none)') ],
35 <& /elements/tr-select-part_referral.html,
36 'label' => emt('Advertising Source'),
38 #no, causes customers with disabled ones to disappear
43 <TD ALIGN="right" VALIGN="center"><% mt('Signup date') |h %></TD>
46 <& /elements/tr-input-beginning_ending.html,
47 prefix => 'signupdate',
54 % if ( $conf->exists('cust_main-enable_birthdate') ) {
56 <TD ALIGN="right" VALIGN="center"><% mt('Date of Birth') |h %></TD>
59 <& /elements/tr-input-beginning_ending.html,
60 prefix => 'birthdate',
68 % if ( $conf->exists('cust_main-enable_spouse_birthdate') ) {
70 <TD ALIGN="right" VALIGN="center"><% mt('Spouse Date of Birth') |h %></TD>
73 <& /elements/tr-input-beginning_ending.html,
74 prefix => 'spouse_birthdate',
82 % if ( $conf->exists('cust_main-enable_anniversary_date') ) {
84 <TD ALIGN="right" VALIGN="center"><% mt('Anniversary Date') |h %></TD>
87 <& /elements/tr-input-beginning_ending.html,
88 prefix => 'anniversary_date',
97 <TD ALIGN="right">Tags</TD>
99 <& /elements/select-cust_tag.html,
104 <DIV STYLE="display:inline-block; vertical-align:baseline">
105 <INPUT TYPE="radio" NAME="all_tags" VALUE="0" CHECKED> Any of these
107 <INPUT TYPE="radio" NAME="all_tags" VALUE="1"> All of these
113 <TH CLASS="background" COLSPAN=2> </TH>
116 <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1"><% mt('Package search options') |h %></FONT></TH>
120 <TD ALIGN="right">With</TD>
121 <TD><SELECT NAME="any_pkg_status">
122 <OPTION VALUE="0">active packages
123 <OPTION VALUE="1">any status packages
129 <TD ALIGN="right">of class</TD>
131 <& /elements/select-pkg_class.html,
132 'field' => 'pkg_classnum',
135 <DIV STYLE="display:inline-block; vertical-align:baseline">
136 <INPUT TYPE="radio" NAME="all_pkg_classnums" VALUE="0" CHECKED>
139 <INPUT TYPE="radio" NAME="all_pkg_classnums" VALUE="1">
146 <TH CLASS="background" COLSPAN=2> </TH>
150 <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1"><% mt('Location search options') |h %></FONT></TH>
154 <TD ALIGN="right" VALIGN="center"><% mt('Address') |h %></TD>
155 <TD><INPUT TYPE="text" NAME="address" SIZE=54></TD>
159 <TD ALIGN="right" VALIGN="center"><% mt('City') |h %></TD>
161 <& /elements/city.html,
163 empty_label => '(all)',
170 <TD ALIGN="right" VALIGN="center"><% mt('County') |h %></TD>
172 <& /elements/select-county.html,
174 empty_label => '(all)',
180 <TD ALIGN="right" VALIGN="center"><% mt('State') |h %></TD>
182 <& /elements/select-state.html,
184 empty_label => '(all)',
190 <TD ALIGN="right" VALIGN="center"><% mt('Zip') |h %></TD>
191 <TD><INPUT TYPE="text" NAME="zip" SIZE=12></TD>
195 <TD ALIGN="right" VALIGN="center"><% mt('Country') |h %></TD>
197 <& /elements/select-country.html,
199 state_disable_empty => 0,
200 state_empty_label => '(all)',
206 <TH CLASS="background" COLSPAN=2> </TH>
210 <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1"><% mt('Billing search options') |h %></FONT></TH>
213 <& /elements/tr-select-payby.html,
214 'payby_type' => 'cust',
220 <TD ALIGN="right"><% mt('Payment expiration before') |h %></TD>
222 <SELECT NAME="paydate_month" DISABLED>
223 % foreach my $month ( 1 .. 12 ) {
224 <OPTION VALUE="<% $month %>"><% $month %></OPTION>
228 <SELECT NAME="paydate_year" onChange="paydate_year_changed(this);">
229 <OPTION VALUE=""></OPTION>
230 % my $lastyear = (localtime(time))[5] + 1899;
231 % foreach my $year ( $lastyear .. $lastyear+12 ) {
232 <OPTION VALUE="<% $year %>"><% $year %></OPTION>
238 <SCRIPT TYPE="text/javascript">
239 function paydate_year_changed(what) {
240 var value = what.options[what.selectedIndex].value;
241 var month_select = what.form.paydate_month;
243 month_select.disabled = true;
245 month_select.disabled = false;
250 % my @exempt_groups = grep /\S/, $conf->config('tax-cust_exempt-groups');
251 % unless ( @exempt_groups ) {
253 % #falze laziness with With/Without postal mail invoices
255 <TD ALIGN="right" VALIGN="center"><% mt('Tax exempt') |h %></TD>
256 <TD><INPUT TYPE="checkbox" NAME="tax" ID="tax" onClick="tax_changed();"></TD>
260 <TD ALIGN="right" VALIGN="center"><% mt('Not tax exempt') |h %></TD>
261 <TD><INPUT TYPE="checkbox" NAME="no_tax" ID="no_tax" onClick="no_tax_changed();"></TD>
264 <SCRIPT TYPE="text/javascript">
265 function tax_changed() {
266 if ( document.getElementById('tax').checked == true ) {
267 document.getElementById('no_tax').checked = false;
270 function no_tax_changed() {
271 if ( document.getElementById('no_tax').checked == true ) {
272 document.getElementById('tax').checked = false;
279 <TD ALIGN="right"><% mt('Invoice terms') |h %></TD>
281 % my @agentnums = $FS::CurrentUser::CurrentUser->agentnums;
282 % my $agentnum = scalar(@agentnums) == 1 ? $agentnums[0] : '';
283 <& /elements/select-terms.html,
284 'pre_options' => [ '' => emt('all') ],
285 'empty_value' => 'NULL',
286 'agentnum' => $agentnum,
291 <& /elements/tr-input-lessthan_greaterthan.html,
292 label => emt('Current balance'),
293 field => 'current_balance',
297 <TD ALIGN="right" VALIGN="center"><% mt('With invoicing email address(es)') |h %></TD>
298 <TD><INPUT TYPE="checkbox" NAME="with_email"></TD>
302 <TD ALIGN="right" VALIGN="center"><% mt('With postal mail invoices') |h %></TD>
303 <TD><INPUT TYPE="checkbox" NAME="POST" ID="POST" onClick="POST_changed();"></TD>
307 <TD ALIGN="right" VALIGN="center"><% mt('Without postal mail invoices') |h %></TD>
308 <TD><INPUT TYPE="checkbox" NAME="no_POST" ID="no_POST" onClick="no_POST_changed();"></TD>
311 <SCRIPT TYPE="text/javascript">
312 function POST_changed() {
313 if ( document.getElementById('POST').checked == true ) {
314 document.getElementById('no_POST').checked = false;
317 function no_POST_changed() {
318 if ( document.getElementById('no_POST').checked == true ) {
319 document.getElementById('POST').checked = false;
325 <TH CLASS="background" COLSPAN=2> </TH>
329 <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1"><% mt('Display options') |h %></FONT></TH>
331 <& /elements/tr-select-cust-fields.html &>
334 <TD ALIGN="right" VALIGN="center"><% mt('Add package columns') |h %></TD>
335 <TD><INPUT TYPE="checkbox" NAME="flattened_pkgs"></TD>
339 <TD ALIGN="right" VALIGN="center"><% mt('Include cancelled packages') |h %></TD>
340 <TD><INPUT TYPE="checkbox" NAME="cancelled_pkgs"></TD>
344 <TH ALIGN="right" VALIGN="center"><% mt('Search historical addresses') %></TH>
345 <TD><INPUT TYPE="checkbox" NAME="location_history" VALUE="1"></TD>
350 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
354 <& /elements/footer.html &>
358 unless $FS::CurrentUser::CurrentUser->access_right('Advanced customer search');
360 my $conf = new FS::Conf;