summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/search')
-rw-r--r--httemplate/search/cust_timespan.html7
-rw-r--r--httemplate/search/elements/search.html15
-rw-r--r--httemplate/search/report_cust_timespan.html2
3 files changed, 16 insertions, 8 deletions
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>