summaryrefslogtreecommitdiff
path: root/httemplate/search/cust_bill_pkg.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/search/cust_bill_pkg.cgi')
-rw-r--r--httemplate/search/cust_bill_pkg.cgi12
1 files changed, 10 insertions, 2 deletions
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";