summaryrefslogtreecommitdiff
path: root/FS/FS/Cron
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-06-06 13:48:01 -0700
committerIvan Kohler <ivan@freeside.biz>2014-06-06 13:48:01 -0700
commit4f335eca5fd1efa2c823d461f7e34feded4e4990 (patch)
tree32c863c7aea807359fdfc1c11131fa240b03283d /FS/FS/Cron
parente1bf0136f69f20fb301c188d9d98e9f3ec051a6a (diff)
fix dated one-time charges with freeside-daily -d, RT#29339
Diffstat (limited to 'FS/FS/Cron')
-rw-r--r--FS/FS/Cron/bill.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/FS/FS/Cron/bill.pm b/FS/FS/Cron/bill.pm
index 807d5cf..d3f1eb4 100644
--- a/FS/FS/Cron/bill.pm
+++ b/FS/FS/Cron/bill.pm
@@ -210,6 +210,8 @@ sub bill_where {
my $conf = new FS::Conf;
my $billtime = $conf->exists('next-bill-ignore-time') ? day_end($time) : $time;
+ # corresponds to perl checks in FS::cust_main::Billing sub bill
+ # ("bill setup" and "bill recurring fee")
# select * from cust_main where
my $where_pkg = <<"END";
EXISTS(
@@ -218,7 +220,7 @@ sub bill_where {
AND ( cancel IS NULL OR cancel = 0 )
AND ( ( ( cust_pkg.setup IS NULL OR cust_pkg.setup = 0 )
AND ( start_date IS NULL OR start_date = 0
- OR ( start_date IS NOT NULL AND start_date <= $^T )
+ OR ( start_date IS NOT NULL AND start_date <= $billtime )
)
)
OR ( freq != '0' AND ( bill IS NULL OR bill <= $billtime ) )