summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2015-04-23 11:10:39 -0700
committerMark Wells <mark@freeside.biz>2015-04-23 11:10:39 -0700
commit326075e45814387624303357207eae9069301f58 (patch)
treebd8714f08764bbedd501145c14909df1191d24fd
parentfb3f24328beb8e4d8703ea0d5376cdaaa86533a0 (diff)
calculate current day consistently for sync_bill_date + prorate_round_day, #34622
-rw-r--r--FS/FS/part_pkg/flat.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm
index d9d4588..930966a 100644
--- a/FS/FS/part_pkg/flat.pm
+++ b/FS/FS/part_pkg/flat.pm
@@ -179,6 +179,12 @@ sub cutoff_day {
if ( $self->option('sync_bill_date',1) ) {
my $next_bill = $cust_pkg->cust_main->next_bill_date;
if ( defined($next_bill) ) {
+ # careful here. if the prorate calculation is going to round to
+ # the nearest day, this needs to always return the same result
+ if ( $self->option('prorate_round_day', 1) ) {
+ my $hour = (localtime($next_bill))[2];
+ $next_bill += 64800 if $hour >= 12;
+ }
return (localtime($next_bill))[3];
}
}