summaryrefslogtreecommitdiff
path: root/FS/FS/cust_pkg
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-02-28 17:22:09 -0800
committerMark Wells <mark@freeside.biz>2014-02-28 17:22:09 -0800
commitc2e6d527477334107535c74b44e238cc656f3449 (patch)
tree9ec3b6c68e32f0b6cbcdf78a8c29a2a50809d066 /FS/FS/cust_pkg
parenta6aab02211b2efd3790f7c2b55365dc7bc3294ca (diff)
477 report as of a specific date, #24980
Diffstat (limited to 'FS/FS/cust_pkg')
-rw-r--r--FS/FS/cust_pkg/Search.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/FS/FS/cust_pkg/Search.pm b/FS/FS/cust_pkg/Search.pm
index 43b8703..47efd31 100644
--- a/FS/FS/cust_pkg/Search.pm
+++ b/FS/FS/cust_pkg/Search.pm
@@ -397,12 +397,18 @@ sub search {
);
if( exists($params->{'active'} ) ) {
- # This overrides all the other date-related fields
+ # This overrides all the other date-related fields, and includes packages
+ # that were active at some time during the interval. It excludes:
+ # - packages that were set up after the end of the interval
+ # - packages that were canceled before the start of the interval
+ # - packages that were suspended before the start of the interval
+ # and are still suspended now
my($beginning, $ending) = @{$params->{'active'}};
push @where,
"cust_pkg.setup IS NOT NULL",
"cust_pkg.setup <= $ending",
"(cust_pkg.cancel IS NULL OR cust_pkg.cancel >= $beginning )",
+ "(cust_pkg.susp IS NULL OR cust_pkg.susp >= $beginning )",
"NOT (".FS::cust_pkg->onetime_sql . ")";
}
else {