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') ),
19 <% include( '/elements/tr-select-cust_pkg-status.html',
20 'onchange' => 'status_changed(this);',
24 <SCRIPT TYPE="text/javascript">
26 function status_changed(what) {
28 % foreach my $status ( '', FS::cust_pkg->statuses() ) {
30 if ( what.options[what.selectedIndex].value == '<% $status %>' ) {
32 % foreach my $field (qw( setup last_bill bill adjourn susp expire cancel )) {
33 % if ( $disable{$status}->{$field} ) {
35 what.form.<% $field %>_beginning_text.disabled = true;
36 what.form.<% $field %>_ending_text.disabled = true;
37 what.form.<% $field %>_beginning_text.style.backgroundColor = '#dddddd';
38 what.form.<% $field %>_ending_text.style.backgroundColor = '#dddddd';
40 what.form.<% $field %>_beginning_button.style.display = 'none';
41 what.form.<% $field %>_ending_button.style.display = 'none';
42 what.form.<% $field %>_beginning_disabled.style.display = '';
43 what.form.<% $field %>_ending_disabled.style.display = '';
47 what.form.<% $field %>_beginning_text.disabled = false;
48 what.form.<% $field %>_ending_text.disabled = false;
49 what.form.<% $field %>_beginning_text.style.backgroundColor = '#ffffff';
50 what.form.<% $field %>_ending_text.style.backgroundColor = '#ffffff';
52 what.form.<% $field %>_beginning_button.style.display = '';
53 what.form.<% $field %>_ending_button.style.display = '';
54 what.form.<% $field %>_beginning_disabled.style.display = 'none';
55 what.form.<% $field %>_ending_disabled.style.display = 'none';
68 <% include( '/elements/tr-select-pkg_class.html',
69 'pre_options' => [ '0' => 'all' ],
70 'empty_label' => '(empty class)',
74 % foreach my $field (qw( setup last_bill bill adjourn susp expire cancel )) {
77 <TD ALIGN="right" VALIGN="center"><% $label{$field} %></TD>
80 <% include( '/elements/tr-input-beginning_ending.html',
91 <% include( '/elements/tr-selectmultiple-part_pkg.html' ) %>
94 <TH BGCOLOR="#e8e8e8" COLSPAN=2> </TH>
98 <TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Display options</FONT></TH>
100 <% include( '/elements/tr-select-cust-fields.html' ) %>
105 <INPUT TYPE="submit" VALUE="Get Report">
109 <% include('/elements/footer.html') %>
113 unless $FS::CurrentUser::CurrentUser->access_right('List packages');
120 'last_bill' => 'Last bill',
121 'bill' => 'Next bill',
122 'adjourn' => 'Adjourns',
123 'susp' => 'Suspended',
124 'expire' => 'Expires',
125 'cancel' => 'Cancelled',
128 #false laziness w/cust_pkg.cgi
131 'one-time charge' => { 'last_bill'=>1, 'bill'=>1, 'adjourn'=>1, 'susp'=>1, 'expire'=>1, 'cancel'=>1, },
132 'active' => { 'susp'=>1, 'cancel'=>1 },
133 'suspended' => { 'cancel' => 1 },