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 'curr_value' => scalar( $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 adjourn susp expire cancel )) {
30 % if ( $disable{$status}->{$field} ) {
32 what.form.<% $field %>_beginning_text.disabled = true;
33 what.form.<% $field %>_ending_text.disabled = true;
34 what.form.<% $field %>_beginning_text.style.backgroundColor = '#dddddd';
35 what.form.<% $field %>_ending_text.style.backgroundColor = '#dddddd';
37 what.form.<% $field %>_beginning_button.style.display = 'none';
38 what.form.<% $field %>_ending_button.style.display = 'none';
39 what.form.<% $field %>_beginning_disabled.style.display = '';
40 what.form.<% $field %>_ending_disabled.style.display = '';
44 what.form.<% $field %>_beginning_text.disabled = false;
45 what.form.<% $field %>_ending_text.disabled = false;
46 what.form.<% $field %>_beginning_text.style.backgroundColor = '#ffffff';
47 what.form.<% $field %>_ending_text.style.backgroundColor = '#ffffff';
49 what.form.<% $field %>_beginning_button.style.display = '';
50 what.form.<% $field %>_ending_button.style.display = '';
51 what.form.<% $field %>_beginning_disabled.style.display = 'none';
52 what.form.<% $field %>_ending_disabled.style.display = 'none';
65 <% include( '/elements/tr-select-pkg_class.html',
66 'pre_options' => [ '0' => 'all' ],
67 'empty_label' => '(empty class)',
71 % foreach my $field (qw( setup last_bill bill adjourn susp expire cancel )) {
74 <TD ALIGN="right" VALIGN="center"><% $label{$field} %></TD>
77 <% include( '/elements/tr-input-beginning_ending.html',
88 <% include( '/elements/tr-selectmultiple-part_pkg.html' ) %>
91 <TH BGCOLOR="#e8e8e8" COLSPAN=2> </TH>
95 <TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Display options</FONT></TH>
97 <% include( '/elements/tr-select-cust-fields.html' ) %>
102 <INPUT TYPE="submit" VALUE="Get Report">
106 <% include('/elements/footer.html') %>
110 unless $FS::CurrentUser::CurrentUser->access_right('List packages');
117 'last_bill' => 'Last bill',
118 'bill' => 'Next bill',
119 'adjourn' => 'Adjourns',
120 'susp' => 'Suspended',
121 'expire' => 'Expires',
122 'cancel' => 'Cancelled',
125 #false laziness w/cust_pkg.cgi
128 'one-time charge' => { 'last_bill'=>1, 'bill'=>1, 'adjourn'=>1, 'susp'=>1, 'expire'=>1, 'cancel'=>1, },
129 'active' => { 'susp'=>1, 'cancel'=>1 },
130 'suspended' => { 'cancel' => 1 },