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">
10 <FONT SIZE="+1">Search options</FONT>
14 <% include( '/elements/tr-select-agent.html',
15 'curr_value' => scalar( $cgi->param('agentnum') ),
20 <% include( '/elements/tr-select-cust_pkg-status.html',
21 'onchange' => 'status_changed(this);',
25 <SCRIPT TYPE="text/javascript">
27 function status_changed(what) {
29 % foreach my $status ( '', FS::cust_pkg->statuses() ) {
31 if ( what.options[what.selectedIndex].value == '<% $status %>' ) {
33 % foreach my $field (qw( setup last_bill bill adjourn susp expire cancel )) {
34 % if ( $disable{$status}->{$field} ) {
36 what.form.<% $field %>_beginning_text.disabled = true;
37 what.form.<% $field %>_ending_text.disabled = true;
38 what.form.<% $field %>_beginning_text.style.backgroundColor = '#dddddd';
39 what.form.<% $field %>_ending_text.style.backgroundColor = '#dddddd';
41 what.form.<% $field %>_beginning_button.style.display = 'none';
42 what.form.<% $field %>_ending_button.style.display = 'none';
43 what.form.<% $field %>_beginning_disabled.style.display = '';
44 what.form.<% $field %>_ending_disabled.style.display = '';
48 what.form.<% $field %>_beginning_text.disabled = false;
49 what.form.<% $field %>_ending_text.disabled = false;
50 what.form.<% $field %>_beginning_text.style.backgroundColor = '#ffffff';
51 what.form.<% $field %>_ending_text.style.backgroundColor = '#ffffff';
53 what.form.<% $field %>_beginning_button.style.display = '';
54 what.form.<% $field %>_ending_button.style.display = '';
55 what.form.<% $field %>_beginning_disabled.style.display = 'none';
56 what.form.<% $field %>_ending_disabled.style.display = 'none';
69 <% include( '/elements/tr-select-pkg_class.html',
70 'pre_options' => [ '0' => 'all' ],
71 'empty_label' => '(empty class)',
75 % foreach my $field (qw( setup last_bill bill adjourn susp expire cancel )) {
78 <TD ALIGN="right" VALIGN="center"><% $label{$field} %></TD>
81 <% include( '/elements/tr-input-beginning_ending.html',
92 <% include( '/elements/tr-selectmultiple-part_pkg.html' ) %>
95 <TH BGCOLOR="#e8e8e8" COLSPAN=2> </TH>
99 <TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Display options</FONT></TH>
101 <% include( '/elements/tr-select-cust-fields.html' ) %>
106 <INPUT TYPE="submit" VALUE="Get Report">
110 <% include('/elements/footer.html') %>
114 unless $FS::CurrentUser::CurrentUser->access_right('List packages');
121 'last_bill' => 'Last bill',
122 'bill' => 'Next bill',
123 'adjourn' => 'Adjourns',
124 'susp' => 'Suspended',
125 'expire' => 'Expires',
126 'cancel' => 'Cancelled',
129 #false laziness w/cust_pkg.cgi
132 'one-time charge' => { 'last_bill'=>1, 'bill'=>1, 'adjourn'=>1, 'susp'=>1, 'expire'=>1, 'cancel'=>1, },
133 'active' => { 'susp'=>1, 'cancel'=>1 },
134 'suspended' => { 'cancel' => 1 },