summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-10-24 21:58:55 -0700
committerIvan Kohler <ivan@freeside.biz>2013-10-24 21:58:55 -0700
commit9be8cf75b8e510fb0e6489f90188d391b861b247 (patch)
tree2d8ea8d94161de49cbcfa22225ccd2f5e225297c
parent30ef568f955526b259892399ba7432dbfce46347 (diff)
fix next-bill-ignore-time, RT#24318, RT#24476, RT#12570
-rw-r--r--FS/FS/cust_main/Billing.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm
index aeb3feced..608dbe15e 100644
--- a/FS/FS/cust_main/Billing.pm
+++ b/FS/FS/cust_main/Billing.pm
@@ -356,6 +356,11 @@ sub bill {
my $time = $options{'time'} || time;
my $invoice_time = $options{'invoice_time'} || $time;
+ my $cmp_time = ( $conf->exists('next-bill-ignore-time')
+ ? day_end( $time )
+ : $time
+ );
+
$options{'not_pkgpart'} ||= {};
$options{'not_pkgpart'} = { map { $_ => 1 }
split(/\s*,\s*/, $options{'not_pkgpart'})
@@ -443,7 +448,7 @@ sub bill {
my $next_bill = $cust_pkg->getfield('bill') || 0;
my $error;
- while ( $next_bill <= $time ) {
+ while ( $next_bill <= $cmp_time ) {
$error =
$self->_make_lines( 'part_pkg' => $part_pkg,
'cust_pkg' => $cust_pkg,