diff options
author | Christopher Burger <burgerc@freeside.biz> | 2018-07-27 18:14:31 -0400 |
---|---|---|
committer | Christopher Burger <burgerc@freeside.biz> | 2018-07-27 18:14:31 -0400 |
commit | b548768fbbcdcae4df6f46ac38f0615437a20298 (patch) | |
tree | 7e2f8c97b8f540a30c8574d4eb5af589f4dc15a1 /httemplate/search/cust_timespan.html | |
parent | 25efd7207d9ea9be4bea1093917c0d8dc4b1e87a (diff) |
RT# 77160 - added date search on customer timespan report
Diffstat (limited to 'httemplate/search/cust_timespan.html')
-rw-r--r-- | httemplate/search/cust_timespan.html | 7 |
1 files changed, 6 insertions, 1 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) |