summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-06-12 15:04:53 -0700
committerIvan Kohler <ivan@freeside.biz>2013-06-12 15:04:53 -0700
commit6efb75c59ac446557ad4050e86f0445d515b465e (patch)
tree90600055473c308f4e7cfb13c541bef963e95ba4 /httemplate/search
parent16a005e2f937a62a2a6633974979b614a41e34c8 (diff)
add package class selection to package summary report, RT#23555
Diffstat (limited to 'httemplate/search')
-rw-r--r--httemplate/search/cust_pkg_summary.cgi9
-rw-r--r--httemplate/search/cust_pkg_summary.html11
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"