[freeside-commits] branch FREESIDE_4_BRANCH updated. 1af581404eae84707fa1c66e3f455eb433e3b16b

Christopher Burger burgerc at freeside.biz
Mon Jul 30 05:26:55 PDT 2018


The branch, FREESIDE_4_BRANCH has been updated
       via  1af581404eae84707fa1c66e3f455eb433e3b16b (commit)
      from  c39471b25c33e345e79034dc43ad9807d2e6d57d (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 1af581404eae84707fa1c66e3f455eb433e3b16b
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 2979eaadc..209302a5d 100644
--- a/httemplate/search/elements/search.html
+++ b/httemplate/search/elements/search.html
@@ -385,14 +385,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