X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fsearch%2Fcust_bill_pkg.cgi;h=94860d3f2d4137de69ebf1af5136438a14e93045;hb=ea3ce8d7f076e7fecff4be7ae63bc413adb0adf5;hp=13fb9f836438b4be3d240b506e3999d32352117c;hpb=980123f76a0d19a7e875c6655c4912d7ea239446;p=freeside.git 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";