search for payments by customer location, RT#76691
[freeside.git] / httemplate / search / report_cust_main.html
1 <& /elements/header.html, mt('Customer Report') &>
2
3 <FORM ACTION="cust_main.html" METHOD="GET">
4 <INPUT TYPE="hidden" NAME="magic" VALUE="bill">
5
6   <FONT CLASS="fsinnerbox-title"><% emt('Basic search options') %></FONT>
7   <TABLE CLASS="fsinnerbox">
8
9     <& /elements/tr-select-agent.html,
10                   'curr_value'    => scalar($cgi->param('agentnum')),
11                   'disable_empty' => 0,
12     &>
13
14     <& /elements/tr-select-sales.html,
15                   'curr_value'    => scalar($cgi->param('salesnum')),
16                   'pre_options'   => [ '' => 'all',
17                                        0  => '(none)', ],
18                   'disable_empty' => 1,
19                   'th' => 1,
20     &>
21
22     <& /elements/tr-select-cust_main-status.html,
23                   'label' => emt('Status'),
24     &>
25
26     <& /elements/tr-select-cust_class.html,
27                   'label'        => emt('Class'),
28                   'multiple'     => 1,
29                   'pre_options'  => [ '' => emt('(none)') ],
30                   'all_selected' => 1,
31     &>
32
33     <& /elements/tr-select-part_referral.html,
34                   'label'        => emt('Advertising Source'),
35                   'multiple'     => 1,
36                   #no, causes customers with disabled ones to disappear
37                   #'all_selected' => 1,
38     &>
39
40     <TR>
41         <TH ALIGN="right" VALIGN="center"><% mt('Signup date') |h %></TH>
42         <TD>
43         <TABLE>
44             <& /elements/tr-input-beginning_ending.html,
45                       prefix   => 'signupdate',
46                       layout   => 'horiz',
47             &>
48         </TABLE>
49         </TD>
50     </TR>
51
52 %    if ( $conf->exists('cust_main-enable_birthdate') ) {
53       <TR>
54           <TH ALIGN="right" VALIGN="center"><% mt('Date of Birth') |h %></TH>
55           <TD>
56           <TABLE>
57               <& /elements/tr-input-beginning_ending.html,
58                         prefix   => 'birthdate',
59                         layout   => 'horiz',
60               &>
61           </TABLE>
62           </TD>
63       </TR>
64 %   }
65
66 %    if ( $conf->exists('cust_main-enable_spouse_birthdate') ) {
67       <TR>
68           <TH ALIGN="right" VALIGN="center"><% mt('Spouse Date of Birth') |h %></TH>
69           <TD>
70           <TABLE>
71               <& /elements/tr-input-beginning_ending.html,
72                         prefix   => 'spouse_birthdate',
73                         layout   => 'horiz',
74               &>
75           </TABLE>
76           </TD>
77       </TR>
78 %   }
79
80 %    if ( $conf->exists('cust_main-enable_anniversary_date') ) {
81       <TR>
82           <TH ALIGN="right" VALIGN="center"><% mt('Anniversary Date') |h %></TH>
83           <TD>
84           <TABLE>
85               <& /elements/tr-input-beginning_ending.html,
86                         prefix   => 'anniversary_date',
87                         layout   => 'horiz',
88               &>
89           </TABLE>
90           </TD>
91       </TR>
92 %   }
93
94       <TR>
95         <TH ALIGN="right">Tags</TH>
96         <TD>
97             <& /elements/select-cust_tag.html,
98                           'cgi'         => $cgi,
99                           'is_report'   => 1,
100                           'multiple'    => 1,
101             &>
102           <DIV STYLE="display:inline-block; vertical-align:baseline">
103             <INPUT TYPE="radio" NAME="all_tags" VALUE="0" CHECKED> Any of these
104             <BR>
105             <INPUT TYPE="radio" NAME="all_tags" VALUE="1"> All of these
106           </DIV>
107         </TD>
108       </TR>
109
110   </TABLE>
111   <BR>
112
113   <FONT CLASS="fsinnerbox-title"><% emt('Package search options') %></FONT>
114   <TABLE CLASS="fsinnerbox">
115
116       <TR>
117
118         <TH ALIGN="right">With</TH>
119         <TD><SELECT NAME="any_pkg_status">
120               <OPTION VALUE="0">active packages
121               <OPTION VALUE="1">any status packages
122             </SELECT>
123         </TD>
124      </TR>
125
126         <TH ALIGN="right">of class</TH>
127         <TD>
128             <& /elements/select-pkg_class.html,
129                           'field'       => 'pkg_classnum',
130                           'multiple'    => 1,
131             &>
132           <DIV STYLE="display:inline-block; vertical-align:baseline">
133             <INPUT TYPE="radio" NAME="all_pkg_classnums" VALUE="0" CHECKED>
134               Any of these
135             <BR>
136             <INPUT TYPE="radio" NAME="all_pkg_classnums" VALUE="1">
137               All of these
138           </DIV>
139         </TD>
140       </TR>
141
142   </TABLE>
143   <BR>
144
145   <FONT CLASS="fsinnerbox-title"><% emt('Location search options') %></FONT>
146   <TABLE CLASS="fsinnerbox">
147     <& elements/options_cust_location.html &>
148   </TABLE>
149   <BR>
150
151   <FONT CLASS="fsinnerbox-title"><% emt('Billing search options') %></FONT>
152   <TABLE CLASS="fsinnerbox">
153
154 % my @exempt_groups = grep /\S/, $conf->config('tax-cust_exempt-groups');
155 % unless ( @exempt_groups ) { 
156
157 %   #falze laziness with With/Without postal mail invoices
158      <TR>
159       <TH ALIGN="right" VALIGN="center"><% mt('Tax exempt') |h %></TH>
160         <TD><INPUT TYPE="checkbox" NAME="tax" ID="tax" onClick="tax_changed();"></TD>
161     </TR>
162
163     <TR>
164       <TH ALIGN="right" VALIGN="center"><% mt('Not tax exempt') |h %></TH>
165         <TD><INPUT TYPE="checkbox" NAME="no_tax" ID="no_tax" onClick="no_tax_changed();"></TD>
166     </TR>
167
168     <SCRIPT TYPE="text/javascript">
169       function  tax_changed() {
170         if ( document.getElementById('tax').checked == true ) {
171           document.getElementById('no_tax').checked = false;
172         }
173       }
174       function no_tax_changed() {
175         if ( document.getElementById('no_tax').checked == true ) {
176           document.getElementById('tax').checked = false;
177         }
178       }
179     </SCRIPT>
180 % }
181
182     <TR>
183       <TH ALIGN="right"><% mt('Invoice terms') |h %></TH>
184       <TD>
185 %       my @agentnums = $FS::CurrentUser::CurrentUser->agentnums;
186 %       my $agentnum = scalar(@agentnums) == 1 ? $agentnums[0] : '';
187         <& /elements/select-terms.html,
188              'pre_options' => [ '' => emt('all') ],
189              'empty_value' => 'NULL',
190              'agentnum'    => $agentnum,
191         &>
192       </TD>
193     </TR>
194     
195     <& /elements/tr-input-lessthan_greaterthan.html,
196                   label   => emt('Current balance'),
197                   field   => 'current_balance',
198     &>
199
200     <TR>
201       <TH ALIGN="right" VALIGN="center"><% mt('With invoicing email address(es)') |h %></TH>
202         <TD><INPUT TYPE="checkbox" NAME="with_email"></TD>
203     </TR>
204
205     <TR>
206       <TH ALIGN="right" VALIGN="center"><% mt('With postal mail invoices') |h %></TH>
207         <TD><INPUT TYPE="checkbox" NAME="POST" ID="POST" onClick="POST_changed();"></TD>
208     </TR>
209
210     <TR>
211       <TH ALIGN="right" VALIGN="center"><% mt('Without postal mail invoices') |h %></TH>
212         <TD><INPUT TYPE="checkbox" NAME="no_POST" ID="no_POST" onClick="no_POST_changed();"></TD>
213     </TR>
214
215     <SCRIPT TYPE="text/javascript">
216       function POST_changed() {
217         if ( document.getElementById('POST').checked == true ) {
218           document.getElementById('no_POST').checked = false;
219         }
220       }
221       function no_POST_changed() {
222         if ( document.getElementById('no_POST').checked == true ) {
223           document.getElementById('POST').checked = false;
224         }
225       }
226     </SCRIPT>
227
228   </TABLE>
229   <BR>
230
231   <FONT CLASS="fsinnerbox-title"><% emt('Display options') %></FONT>
232   <TABLE CLASS="fsinnerbox">
233
234     <& /elements/tr-select-cust-fields.html &>
235
236     <TR>
237       <TH ALIGN="right" VALIGN="center"><% mt('Add package columns') |h %></TH>
238         <TD><INPUT TYPE="checkbox" NAME="flattened_pkgs"></TD>
239     </TR>
240
241     <TR>
242       <TH ALIGN="right" VALIGN="center"><% mt('Include cancelled packages') |h %></TH>
243         <TD><INPUT TYPE="checkbox" NAME="cancelled_pkgs"></TD>
244     </TR>
245
246   </TABLE>
247
248 <BR>
249 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
250
251 </FORM>
252
253 <& /elements/footer.html &>
254 <%init>
255
256 die "access denied"
257   unless $FS::CurrentUser::CurrentUser->access_right('Advanced customer search');
258
259 my $conf = new FS::Conf;
260
261 </%init>