From c1fa2b017e4f7d79e47e4e2257f17cf8a3d0c84b Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 10 Jan 2012 18:38:44 +0000 Subject: projected sales report, #15393 --- httemplate/search/cust_bill_pkg.cgi | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'httemplate/search') diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi index 13fb9f836..94860d3f2 100644 --- a/httemplate/search/cust_bill_pkg.cgi +++ b/httemplate/search/cust_bill_pkg.cgi @@ -145,8 +145,16 @@ my $agentnums_sql = my @where = ( $agentnums_sql ); my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi); -push @where, "_date >= $beginning", - "_date <= $ending"; + +if ( $cgi->param('distribute') == 1 ) { + push @where, "sdate <= $ending", + "edate > $beginning", + ; +} +else { + push @where, "_date >= $beginning", + "_date <= $ending"; +} if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) { push @where, "cust_main.agentnum = $1"; -- cgit v1.2.1