X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fflat.pm;h=2201384e8489cc14433e134da383d51c71c542a9;hb=06cb92dc485e9f46de39307f971907bfdef119a3;hp=f3a2b85a5bc798c98282cac076ec2fadf4ebd1c6;hpb=7070356f09267ce78440bff9f36d7ce6cfcd1802;p=freeside.git

diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm
index f3a2b85a5..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];
     }
   }
@@ -256,6 +262,7 @@ sub is_prepaid { 0; } #no, we're postpaid
 sub can_start_date {
   my $self = shift;
   my %opt = @_;
+  return 0 if $self->start_on_hold;
 
   ! $self->option('start_1st', 1) && (   ! $self->option('sync_bill_date',1)
                                       || ! $self->option('prorate_defer_bill',1)