diff options
-rw-r--r-- | httemplate/search/cust_pkg_summary.cgi | 9 | ||||
-rw-r--r-- | httemplate/search/cust_pkg_summary.html | 11 |
2 files changed, 17 insertions, 3 deletions
diff --git a/httemplate/search/cust_pkg_summary.cgi b/httemplate/search/cust_pkg_summary.cgi index fbeeb92ce..d3274894f 100644 --- a/httemplate/search/cust_pkg_summary.cgi +++ b/httemplate/search/cust_pkg_summary.cgi @@ -71,6 +71,15 @@ my $agentnums_sql = $curuser->agentnums_sql( my $extra_sql = " WHERE $agentnums_sql"; +#tiny bit of false laziness w/cust_pkg.pm::search +if ( grep { $_ eq 'classnum' } $cgi->param ) { + if ( $cgi->param('classnum') eq '' ) { + $extra_sql .= ' AND part_pkg.classnum IS NULL'; + } elsif ( $cgi->param('classnum') =~ /^(\d+)$/ && $1 ne '0' ) { + $extra_sql .= " AND part_pkg.classnum = $1 "; + } +} + foreach my $part_pkg (qsearch({ 'table' => 'part_pkg', 'hashref' => {}, 'extra_sql' => $extra_sql, diff --git a/httemplate/search/cust_pkg_summary.html b/httemplate/search/cust_pkg_summary.html index 8c05f7382..18a5690d0 100644 --- a/httemplate/search/cust_pkg_summary.html +++ b/httemplate/search/cust_pkg_summary.html @@ -1,4 +1,4 @@ -<% include( '/elements/header.html', 'Package Summary Report' ) %> +<& /elements/header.html, 'Package Summary Report' &> <FORM ACTION="cust_pkg_summary.cgi" METHOD="GET"> @@ -10,7 +10,12 @@ </TH> </TR> - <% include ('/elements/tr-input-beginning_ending.html') %> + <& /elements/tr-input-beginning_ending.html &> + + <& /elements/tr-select-pkg_class.html, + 'pre_options' => [ '0' => 'all' ], + 'empty_label' => '(empty class)', + &> </TABLE> @@ -19,7 +24,7 @@ </FORM> -<% include('/elements/footer.html') %> +<& /elements/footer.html &> <%init> die "access denied" |