projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fb3f243
)
calculate current day consistently for sync_bill_date + prorate_round_day, #34622
author
Mark Wells
<mark@freeside.biz>
Thu, 23 Apr 2015 18:10:39 +0000
(11:10 -0700)
committer
Mark Wells
<mark@freeside.biz>
Thu, 23 Apr 2015 18:10:39 +0000
(11:10 -0700)
FS/FS/part_pkg/flat.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_pkg/flat.pm
b/FS/FS/part_pkg/flat.pm
index
d9d4588
..
930966a
100644
(file)
--- 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];
}
}