1 <% include('/elements/header.html', 'Package Report' ) %>
3 <FORM ACTION="cust_pkg.cgi" METHOD="GET">
4 <INPUT TYPE="hidden" NAME="magic" VALUE="bill">
6 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
9 <TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Search options</FONT></TH>
11 <% include( '/elements/tr-select-agent.html',
12 $cgi->param('agentnum'),
16 <% include( '/elements/tr-select-cust_pkg-status.html', '',
17 'onchange' => 'status_changed(this);',
21 <SCRIPT TYPE="text/javascript">
23 function status_changed(what) {
25 % foreach my $status ( '', FS::cust_pkg->statuses() ) {
27 if ( what.options[what.selectedIndex].value == '<% $status %>' ) {
29 % foreach my $field (qw( setup last_bill bill susp expire cancel )) {
30 % if ( $disable{$status}->{$field} ) {
32 what.form.<% $field %>_beginning_text.disabled = true;
33 what.form.<% $field %>_ending_text.disabled = true;
35 what.form.<% $field %>_beginning_button.style.display = 'none';
36 what.form.<% $field %>_ending_button.style.display = 'none';
37 what.form.<% $field %>_beginning_disabled.style.display = '';
38 what.form.<% $field %>_ending_disabled.style.display = '';
42 what.form.<% $field %>_beginning_text.disabled = false;
43 what.form.<% $field %>_ending_text.disabled = false;
45 what.form.<% $field %>_beginning_button.style.display = '';
46 what.form.<% $field %>_ending_button.style.display = '';
47 what.form.<% $field %>_beginning_disabled.style.display = 'none';
48 what.form.<% $field %>_ending_disabled.style.display = 'none';
61 <% include( '/elements/tr-select-pkg_class.html', '',
62 'pre_options' => [ '0' => 'all' ],
63 'empty_label' => '(empty class)',
67 % foreach my $field (qw( setup last_bill bill susp expire cancel )) {
70 <TD ALIGN="right" VALIGN="center"><% $label{$field} %></TD>
73 <% include( '/elements/tr-input-beginning_ending.html',
84 <% include( '/elements/tr-selectmultiple-part_pkg.html' ) %>
87 <TH BGCOLOR="#e8e8e8" COLSPAN=2> </TH>
91 <TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Display options</FONT></TH>
93 <% include( '/elements/tr-select-cust-fields.html' ) %>
98 <INPUT TYPE="submit" VALUE="Get Report">
102 <% include('/elements/footer.html') %>
106 unless $FS::CurrentUser::CurrentUser->access_right('List packages');
113 'last_bill' => 'Last bill',
114 'bill' => 'Next bill',
115 'susp' => 'Suspended',
116 'expire' => 'Expires',
117 'cancel' => 'Cancelled',
120 #false laziness w/cust_pkg.cgi
123 'one-time charge' => { 'last_bill'=>1, 'bill'=>1, 'susp'=>1, 'expire'=>1, 'cancel'=>1, },
124 'active' => { 'susp'=>1, 'cancel'=>1 },
125 'suspended' => { 'cancel' => 1 },