X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fflat.pm;h=2201384e8489cc14433e134da383d51c71c542a9;hb=06cb92dc485e9f46de39307f971907bfdef119a3;hp=5fd269642908b390b8027e89f3aebce2d0f8d243;hpb=97566b78dd87ce4f0cda7885d7ca40414b2e69c3;p=freeside.git diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm index 5fd269642..2201384e8 100644 --- a/FS/FS/part_pkg/flat.pm +++ b/FS/FS/part_pkg/flat.pm @@ -171,6 +171,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]; } }