add "payment expiration before" to customer report, RT#6447
[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 BGCOLOR="#e8e8e8" 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 %   foreach my $field (qw( signupdate )) {
32
33       <TR>
34         <TD ALIGN="right" VALIGN="center"><% $label{$field} %></TD>
35         <TD>
36           <TABLE>
37             <% include( '/elements/tr-input-beginning_ending.html',
38                           prefix   => $field,
39                           layout   => 'horiz',
40                       )
41             %>
42           </TABLE>
43         </TD>
44       </TR>
45
46 %   }
47
48     <% include( '/elements/tr-select-payby.html',
49                   'payby_type'   => 'cust',
50                   'multiple'     => 1,
51                   'all_selected' => 1,
52               )
53     %>
54
55     <TR>
56       <TD ALIGN="right">Payment expiration before</TD>
57       <TD>
58         <SELECT NAME="paydate_month" DISABLED>
59 %         foreach my $month ( 1 .. 12 ) {
60             <OPTION VALUE="<% $month %>"><% $month %></OPTION>
61 %         }
62         </SELECT>
63         /
64         <SELECT NAME="paydate_year" onChange="paydate_year_changed(this);">
65           <OPTION VALUE=""></OPTION>
66 %         my $lastyear = (localtime(time))[5] + 1899;
67 %         foreach my $year ( $lastyear .. $lastyear+12 ) {
68             <OPTION VALUE="<% $year %>"><% $year %></OPTION>
69 %         }
70         </SELECT>
71       </TD>
72     </TR>
73
74     <SCRIPT TYPE="text/javascript">
75       function paydate_year_changed(what) {
76         var value = what.options[what.selectedIndex].value;
77         var month_select = what.form.paydate_month;
78         if ( value == '' ) {
79           month_select.disabled = true;
80         } else {
81           month_select.disabled = false;
82         }
83       }
84     </SCRIPT>
85     
86     <% include( '/elements/tr-input-lessthan_greaterthan.html',
87                   label   => 'Current balance',
88                   field   => 'current_balance',
89               )
90     %>
91
92     <TR>
93       <TD ALIGN="right" VALIGN="center">Include cancelled packages</TD>
94         <TD><INPUT TYPE="checkbox" NAME="cancelled_pkgs"></TD>
95     </TR>
96
97 %   if ( $conf->exists('cust_main-require_censustract') ) {
98
99     <TR>
100       <TD ALIGN="right" VALIGN="center">Without census tract</TD>
101         <TD><INPUT TYPE="checkbox" NAME="no_censustract"></TD>
102     </TR>
103
104 %   }
105
106     <TR>
107       <TH BGCOLOR="#e8e8e8" COLSPAN=2>&nbsp;</TH>
108     </TR>
109
110     <TR>
111       <TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Display options</FONT></TH>
112     </TR>
113     <% include( '/elements/tr-select-cust-fields.html' ) %>
114
115     <TR>
116       <TD ALIGN="right" VALIGN="center">Add package columns</TD>
117         <TD><INPUT TYPE="checkbox" NAME="flattened_pkgs"></TD>
118     </TR>
119   </TABLE>
120
121 <BR>
122 <INPUT TYPE="submit" VALUE="Get Report">
123
124 </FORM>
125
126 <% include('/elements/footer.html') %>
127 <%init>
128
129 die "access denied"
130   unless ( $FS::CurrentUser::CurrentUser->access_right('List customers') &&
131            $FS::CurrentUser::CurrentUser->access_right('List packages')
132          );;
133
134 my $conf = new FS::Conf;
135
136 </%init>
137 <%once>
138
139 my %label = (
140   'signupdate'     => 'Signup date',
141 );
142
143 </%once>