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 % if ( scalar( qsearch( 'part_pkg_report_option', { 'disabled' => '' } ) ) ) {
77 <% include( '/elements/tr-select-table.html',
78 'label' => 'Report classes',
79 'table' => 'part_pkg_report_option',
81 'hashref' => { 'disabled' => '' },
82 'element_name' => 'report_option',
83 'multiple' => 'multiple',
89 % foreach my $field (qw( setup last_bill bill adjourn susp expire cancel )) {
92 <TD ALIGN="right" VALIGN="center"><% $label{$field} %></TD>
95 <% include( '/elements/tr-input-beginning_ending.html',
106 <SCRIPT TYPE="text/javascript">
108 function custom_changed(what) {
110 if ( what.checked ) {
112 what.form.pkgpart.disabled = true;
113 what.form.pkgpart.style.backgroundColor = '#dddddd';
117 what.form.pkgpart.disabled = false;
118 what.form.pkgpart.style.backgroundColor = '#ffffff';
126 <% include( '/elements/tr-checkbox.html',
127 'label' => 'Custom packages',
130 'onchange' => 'custom_changed(this);',
134 <% include( '/elements/tr-selectmultiple-part_pkg.html' ) %>
137 <TH BGCOLOR="#e8e8e8" COLSPAN=2> </TH>
141 <TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Display options</FONT></TH>
143 <% include( '/elements/tr-select-cust-fields.html' ) %>
148 <INPUT TYPE="submit" VALUE="Get Report">
152 <% include('/elements/footer.html') %>
156 unless $FS::CurrentUser::CurrentUser->access_right('List packages');
163 'last_bill' => 'Last bill',
164 'bill' => 'Next bill',
165 'adjourn' => 'Adjourns',
166 'susp' => 'Suspended',
167 'expire' => 'Expires',
168 'cancel' => 'Cancelled',
171 #false laziness w/cust_pkg.cgi
174 'not yet billed' => { 'setup'=>1, 'last_bill'=>1, 'bill'=>1, 'adjourn'=>1, 'susp'=>1, 'expire'=>1, 'cancel'=>1, },
175 'one-time charge' => { 'last_bill'=>1, 'bill'=>1, 'adjourn'=>1, 'susp'=>1, 'expire'=>1, 'cancel'=>1, },
176 'active' => { 'susp'=>1, 'cancel'=>1 },
177 'suspended' => { 'cancel' => 1 },