[freeside-commits] branch master updated. b548768fbbcdcae4df6f46ac38f0615437a20298

Christopher Burger burgerc at freeside.biz
Fri Jul 27 15:15:27 PDT 2018


The branch, master has been updated
       via  b548768fbbcdcae4df6f46ac38f0615437a20298 (commit)
      from  25efd7207d9ea9be4bea1093917c0d8dc4b1e87a (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 b548768fbbcdcae4df6f46ac38f0615437a20298
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Fri Jul 27 18:14:31 2018 -0400

    RT# 77160 - added date search on customer timespan report

diff --git a/httemplate/search/cust_timespan.html b/httemplate/search/cust_timespan.html
index f5684251a..f95250a44 100644
--- a/httemplate/search/cust_timespan.html
+++ b/httemplate/search/cust_timespan.html
@@ -11,6 +11,7 @@
                   'header'      => \@header,
                   'fields'      => \@fields,
                   'links'       => \@links,
+                  'disable_maxselect' => '1',
 
 &>
 <%init>
@@ -84,7 +85,11 @@ my $active_pkg_sql = 'select pkgnum from cust_pkg where cust_pkg.custnum = cust_
 
 ## sql to get the first active date, last cancel date, and last reason.
 my $active_date = 'select min(setup) from cust_pkg left join part_pkg using (pkgpart) where cust_pkg.custnum = cust_main.custnum and part_pkg.freq > \'0\'';
-my $cancel_date = 'select max(cancel) from cust_pkg where cust_pkg.custnum = cust_main.custnum';
+
+## set cancel date range here
+my($beginning_date, $ending_date) = FS::UI::Web::parse_beginning_ending($cgi, '');
+my $cancel_date = 'select max(cancel) from cust_pkg left join part_pkg using (pkgpart) where cust_pkg.custnum = cust_main.custnum and part_pkg.freq > \'0\' and (cancel >= '.$beginning_date.' and cancel <= '.$ending_date.')';
+
 my $cancel_reason = 'select reason.reason from cust_pkg
 	left join cust_pkg_reason on (cust_pkg.pkgnum = cust_pkg_reason.pkgnum)
 	left join reason on (cust_pkg_reason.reasonnum = reason.reasonnum)
diff --git a/httemplate/search/elements/search.html b/httemplate/search/elements/search.html
index 0e8c69a51..730a51aa3 100644
--- a/httemplate/search/elements/search.html
+++ b/httemplate/search/elements/search.html
@@ -389,14 +389,15 @@ unless ( $type =~ /^(csv|xml|\w*.xls)$/) {
     #setup some pagination things if we're in html mode
 
     my $conf = new FS::Conf;
-    $confmax = $conf->config('maxsearchrecordsperpage') || 100;
-    if ( $cgi->param('maxrecords') =~ /^(\d+)$/ ) {
-      $maxrecords = $1;
-    } else {
-      $maxrecords ||= $confmax;
-    }
-
     $opt{'disable_maxselect'} ||= $conf->exists('disable_maxselect');
+    unless ($opt{'disable_maxselect'}) {
+      $confmax = $conf->config('maxsearchrecordsperpage') || 100;
+      if ( $cgi->param('maxrecords') =~ /^(\d+)$/ ) {
+        $maxrecords = $1;
+      } else {
+        $maxrecords ||= $confmax;
+      }
+    }
 
     $limit = $maxrecords ? "LIMIT $maxrecords" : '';
 
diff --git a/httemplate/search/report_cust_timespan.html b/httemplate/search/report_cust_timespan.html
index 4ff3bb892..27dd94006 100644
--- a/httemplate/search/report_cust_timespan.html
+++ b/httemplate/search/report_cust_timespan.html
@@ -20,6 +20,8 @@
        'curr_value' => scalar( $cgi->param('cust_status') ),
   &>
 
+  <& /elements/tr-input-beginning_ending.html &>
+
 </FORM>
 
 </TABLE>

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

Summary of changes:
 httemplate/search/cust_timespan.html        |  7 ++++++-
 httemplate/search/elements/search.html      | 15 ++++++++-------
 httemplate/search/report_cust_timespan.html |  2 ++
 3 files changed, 16 insertions(+), 8 deletions(-)




More information about the freeside-commits mailing list