X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fprorate_calendar.pm;h=a8ed8f942ffad97f1ba9444096bc3af81fa3d475;hb=dc83512c36dc6bea2585abada4f88d714c600e55;hp=83a80f5d0220301eec6ac8e80e22833723f26109;hpb=ecc15d03711690d2b2aeeda2bd8ff1119956c583;p=freeside.git diff --git a/FS/FS/part_pkg/prorate_calendar.pm b/FS/FS/part_pkg/prorate_calendar.pm index 83a80f5d0..a8ed8f942 100644 --- a/FS/FS/part_pkg/prorate_calendar.pm +++ b/FS/FS/part_pkg/prorate_calendar.pm @@ -36,7 +36,7 @@ use base 'FS::part_pkg::flat'; }, 'fieldorder' => [ 'cutoff_day', 'prorate_defer_bill', 'prorate_round_day', 'prorate_verbose' ], 'freq' => 'm', - 'weight' => 20, + 'weight' => 23, ); my %freq_max_days = ( # the length of the shortest period of each cycle type @@ -72,7 +72,11 @@ sub check { sub cutoff_day { my( $self, $cust_pkg ) = @_; my @periods = @{ $freq_cutoff_days{$self->freq} }; - my @cutoffs = ($self->option('cutoff_day') || 1); # Jan 1 = 1 + my $prorate_day = $cust_pkg->cust_main->prorate_day + || $self->option('cutoff_day') + || 1; + + my @cutoffs = ($prorate_day); pop @periods; # we don't care about the last one foreach (@periods) { push @cutoffs, $cutoffs[-1] + $_;