1 <& /elements/header.html, mt('Customer Report') &>
3 <FORM ACTION="cust_main.html" METHOD="GET">
4 <INPUT TYPE="hidden" NAME="magic" VALUE="bill">
6 <FONT CLASS="fsinnerbox-title"><% emt('Basic search options') %></FONT>
7 <TABLE CLASS="fsinnerbox">
9 <& /elements/tr-select-agent.html,
10 'curr_value' => scalar($cgi->param('agentnum')),
14 <& /elements/tr-select-sales.html,
15 'curr_value' => scalar($cgi->param('salesnum')),
16 'pre_options' => [ '' => 'all',
22 <& /elements/tr-select-cust_main-status.html,
23 'label' => emt('Status'),
26 <& /elements/tr-select-cust_class.html,
27 'label' => emt('Class'),
29 'pre_options' => [ '' => emt('(none)') ],
33 <& /elements/tr-select-part_referral.html,
34 'label' => emt('Advertising Source'),
36 #no, causes customers with disabled ones to disappear
41 <TH ALIGN="right" VALIGN="center"><% mt('Signup date') |h %></TH>
44 <& /elements/tr-input-beginning_ending.html,
45 prefix => 'signupdate',
52 % if ( $conf->exists('cust_main-enable_birthdate') ) {
54 <TH ALIGN="right" VALIGN="center"><% mt('Date of Birth') |h %></TH>
57 <& /elements/tr-input-beginning_ending.html,
58 prefix => 'birthdate',
66 % if ( $conf->exists('cust_main-enable_spouse_birthdate') ) {
68 <TH ALIGN="right" VALIGN="center"><% mt('Spouse Date of Birth') |h %></TH>
71 <& /elements/tr-input-beginning_ending.html,
72 prefix => 'spouse_birthdate',
80 % if ( $conf->exists('cust_main-enable_anniversary_date') ) {
82 <TH ALIGN="right" VALIGN="center"><% mt('Anniversary Date') |h %></TH>
85 <& /elements/tr-input-beginning_ending.html,
86 prefix => 'anniversary_date',
95 <TH ALIGN="right">Tags</TH>
97 <& /elements/select-cust_tag.html,
102 <DIV STYLE="display:inline-block; vertical-align:baseline">
103 <INPUT TYPE="radio" NAME="all_tags" VALUE="0" CHECKED> Any of these
105 <INPUT TYPE="radio" NAME="all_tags" VALUE="all"> All of these
107 <INPUT TYPE="radio" NAME="all_tags" VALUE="none"> None of these
115 <FONT CLASS="fsinnerbox-title"><% emt('Referral search options') %></FONT>
116 <TABLE CLASS="fsinnerbox">
118 <& /elements/tr-input-text.html,
119 label => emt('At least this many'),
120 field => 'with_referrals',
125 <& /elements/tr-select-cust_main-status.html,
126 label => emt('Referral status'),
127 field => 'referral_status',
133 <FONT CLASS="fsinnerbox-title"><% emt('Package search options') %></FONT>
134 <TABLE CLASS="fsinnerbox">
138 <TH ALIGN="right">With</TH>
139 <TD><SELECT NAME="any_pkg_status">
140 <OPTION VALUE="0">active packages
141 <OPTION VALUE="1">any status packages
146 <TH ALIGN="right">of class</TH>
148 <& /elements/select-pkg_class.html,
149 'field' => 'pkg_classnum',
152 <DIV STYLE="display:inline-block; vertical-align:baseline">
153 <INPUT TYPE="radio" NAME="all_pkg_classnums" VALUE="0" CHECKED>
156 <INPUT TYPE="radio" NAME="all_pkg_classnums" VALUE="1">
165 <FONT CLASS="fsinnerbox-title"><% emt('Location search options') %></FONT>
166 <TABLE CLASS="fsinnerbox">
167 <& elements/options_cust_location.html &>
168 <& elements/cust_main_phones.html &>
172 <FONT CLASS="fsinnerbox-title"><% emt('Contacts search options') %></FONT>
173 <TABLE CLASS="fsinnerbox">
174 <& elements/options_cust_contacts.html,
175 'pre_fix' => 'contacts_',
180 <FONT CLASS="fsinnerbox-title"><% emt('Billing search options') %></FONT>
181 <TABLE CLASS="fsinnerbox">
183 % my @exempt_groups = grep /\S/, $conf->config('tax-cust_exempt-groups');
184 % unless ( @exempt_groups ) {
186 % #falze laziness with With/Without postal mail invoices
188 <TH ALIGN="right" VALIGN="center"><% mt('Tax exempt') |h %></TH>
189 <TD><INPUT TYPE="checkbox" NAME="tax" ID="tax" onClick="tax_changed();"></TD>
193 <TH ALIGN="right" VALIGN="center"><% mt('Not tax exempt') |h %></TH>
194 <TD><INPUT TYPE="checkbox" NAME="no_tax" ID="no_tax" onClick="no_tax_changed();"></TD>
197 <SCRIPT TYPE="text/javascript">
198 function tax_changed() {
199 if ( document.getElementById('tax').checked == true ) {
200 document.getElementById('no_tax').checked = false;
203 function no_tax_changed() {
204 if ( document.getElementById('no_tax').checked == true ) {
205 document.getElementById('tax').checked = false;
212 <TH ALIGN="right"><% mt('Invoice terms') |h %></TH>
214 % my @agentnums = $FS::CurrentUser::CurrentUser->agentnums;
215 % my $agentnum = scalar(@agentnums) == 1 ? $agentnums[0] : '';
216 <& /elements/select-terms.html,
217 'pre_options' => [ '' => emt('all') ],
218 'empty_value' => 'NULL',
219 'agentnum' => $agentnum,
224 <& /elements/tr-input-lessthan_greaterthan.html,
225 label => emt('Current balance'),
226 field => 'current_balance',
230 <TH ALIGN="right" VALIGN="center"><% mt('With invoicing email address(es)') |h %></TH>
231 <TD><INPUT TYPE="checkbox" NAME="with_email"></TD>
235 <TH ALIGN="right" VALIGN="center"><% mt('With postal mail invoices') |h %></TH>
236 <TD><INPUT TYPE="checkbox" NAME="POST" ID="POST" onClick="POST_changed();"></TD>
240 <TH ALIGN="right" VALIGN="center"><% mt('Without postal mail invoices') |h %></TH>
241 <TD><INPUT TYPE="checkbox" NAME="no_POST" ID="no_POST" onClick="no_POST_changed();"></TD>
244 <SCRIPT TYPE="text/javascript">
245 function POST_changed() {
246 if ( document.getElementById('POST').checked == true ) {
247 document.getElementById('no_POST').checked = false;
250 function no_POST_changed() {
251 if ( document.getElementById('no_POST').checked == true ) {
252 document.getElementById('POST').checked = false;
260 <FONT CLASS="fsinnerbox-title"><% emt('Display options') %></FONT>
261 <TABLE CLASS="fsinnerbox">
263 <& /elements/tr-select-cust-fields.html &>
266 <TH ALIGN="right" VALIGN="center"><% mt('Add package columns') |h %></TH>
267 <TD><INPUT TYPE="checkbox" NAME="flattened_pkgs"></TD>
271 <TH ALIGN="right" VALIGN="center"><% mt('Include cancelled packages') |h %></TH>
272 <TD><INPUT TYPE="checkbox" NAME="cancelled_pkgs"></TD>
278 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
282 <& /elements/footer.html &>
286 unless $FS::CurrentUser::CurrentUser->access_right('Advanced customer search');
288 my $conf = new FS::Conf;