[freeside-commits] branch FREESIDE_3_BRANCH updated. 6efb75c59ac446557ad4050e86f0445d515b465e

Ivan ivan at 420.am
Wed Jun 12 15:04:54 PDT 2013


The branch, FREESIDE_3_BRANCH has been updated
       via  6efb75c59ac446557ad4050e86f0445d515b465e (commit)
      from  16a005e2f937a62a2a6633974979b614a41e34c8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6efb75c59ac446557ad4050e86f0445d515b465e
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Jun 12 15:04:53 2013 -0700

    add package class selection to package summary report, RT#23555

diff --git a/httemplate/search/cust_pkg_summary.cgi b/httemplate/search/cust_pkg_summary.cgi
index fbeeb92..d327489 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 8c05f73..18a5690 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"

-----------------------------------------------------------------------

Summary of changes:
 httemplate/search/cust_pkg_summary.cgi  |    9 +++++++++
 httemplate/search/cust_pkg_summary.html |   11 ++++++++---
 2 files changed, 17 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list