This commit was manufactured by cvs2svn to create branch
[freeside.git] / httemplate / search / report_cust_main.html
1 <% include('/elements/header.html', 'Customer Report' ) %>
2
3 <FORM ACTION="cust_main.html" METHOD="GET">
4 <INPUT TYPE="hidden" NAME="magic" VALUE="bill">
5
6   <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
7
8     <TR>
9       <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Search options</FONT></TH>
10     </TR>
11
12     <% include( '/elements/tr-select-agent.html',
13                   'curr_value'    => scalar($cgi->param('agentnum')),
14                   'disable_empty' => 0,
15                )
16     %>
17
18     <% include( '/elements/tr-select-cust_main-status.html',
19                   'label' => 'Status'
20               )
21     %>
22
23     <% include( '/elements/tr-select-cust_class.html',
24                   'label'        => 'Class',
25                   'multiple'     => 1,
26                   'pre_options'  => [ '' => '(none)' ],
27                   'all_selected' => 1,
28               )
29     %>
30
31     <TR>
32       <TD ALIGN="right" VALIGN="center">Address</TD>
33       <TD><INPUT TYPE="text" NAME="address" SIZE=54></TD>
34     </TR>
35
36 %   foreach my $field (qw( signupdate )) {
37
38       <TR>
39         <TD ALIGN="right" VALIGN="center"><% $label{$field} %></TD>
40         <TD>
41           <TABLE>
42             <% include( '/elements/tr-input-beginning_ending.html',
43                           prefix   => $field,
44                           layout   => 'horiz',
45                       )
46             %>
47           </TABLE>
48         </TD>
49       </TR>
50
51 %   }
52
53     <% include( '/elements/tr-select-cust_tag.html',
54                   'cgi'          => $cgi,
55                   'is_report'    => 1,
56                   'multiple'     => 1,
57                   'all_selected' => 1,
58               )
59     %>
60
61     <% include( '/elements/tr-select-payby.html',
62                   'payby_type'   => 'cust',
63                   'multiple'     => 1,
64                   'all_selected' => 1,
65               )
66     %>
67
68     <TR>
69       <TD ALIGN="right">Payment expiration before</TD>
70       <TD>
71         <SELECT NAME="paydate_month" DISABLED>
72 %         foreach my $month ( 1 .. 12 ) {
73             <OPTION VALUE="<% $month %>"><% $month %></OPTION>
74 %         }
75         </SELECT>
76         /
77         <SELECT NAME="paydate_year" onChange="paydate_year_changed(this);">
78           <OPTION VALUE=""></OPTION>
79 %         my $lastyear = (localtime(time))[5] + 1899;
80 %         foreach my $year ( $lastyear .. $lastyear+12 ) {
81             <OPTION VALUE="<% $year %>"><% $year %></OPTION>
82 %         }
83         </SELECT>
84       </TD>
85     </TR>
86
87     <SCRIPT TYPE="text/javascript">
88       function paydate_year_changed(what) {
89         var value = what.options[what.selectedIndex].value;
90         var month_select = what.form.paydate_month;
91         if ( value == '' ) {
92           month_select.disabled = true;
93         } else {
94           month_select.disabled = false;
95         }
96       }
97     </SCRIPT>
98  
99     <TR>
100       <TD ALIGN="right">Invoice terms</TD>
101       <TD>
102         <% include( '/elements/select-terms.html',
103                       'pre_options' => [ '' => 'all' ],
104                       'empty_value' => 'NULL',
105                   )
106         %>
107       </TD>
108     </TR>
109     
110     <% include( '/elements/tr-input-lessthan_greaterthan.html',
111                   label   => 'Current balance',
112                   field   => 'current_balance',
113               )
114     %>
115
116     <TR>
117       <TD ALIGN="right" VALIGN="center">Include cancelled packages</TD>
118         <TD><INPUT TYPE="checkbox" NAME="cancelled_pkgs"></TD>
119     </TR>
120
121     <TR>
122       <TD ALIGN="right" VALIGN="center">Without census tract</TD>
123         <TD><INPUT TYPE="checkbox" NAME="no_censustract"></TD>
124     </TR>
125
126 %   if ( $conf->exists('enable_taxproducts') ) {
127
128       <TR>
129         <TD ALIGN="right" VALIGN="center">With hardcoded tax location</TD>
130           <TD><INPUT TYPE="checkbox" NAME="with_geocode"></TD>
131       </TR>
132
133 %   }
134
135     <TR>
136       <TH CLASS="background" COLSPAN=2>&nbsp;</TH>
137     </TR>
138
139     <TR>
140       <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Display options</FONT></TH>
141     </TR>
142     <% include( '/elements/tr-select-cust-fields.html' ) %>
143
144     <TR>
145       <TD ALIGN="right" VALIGN="center">Add package columns</TD>
146         <TD><INPUT TYPE="checkbox" NAME="flattened_pkgs"></TD>
147     </TR>
148   </TABLE>
149
150 <BR>
151 <INPUT TYPE="submit" VALUE="Get Report">
152
153 </FORM>
154
155 <% include('/elements/footer.html') %>
156 <%init>
157
158 die "access denied"
159   unless ( $FS::CurrentUser::CurrentUser->access_right('List customers') &&
160            $FS::CurrentUser::CurrentUser->access_right('List packages')
161          );
162
163 my $conf = new FS::Conf;
164
165 </%init>
166 <%once>
167
168 my %label = (
169   'signupdate'     => 'Signup date',
170 );
171
172 </%once>