projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
per-customer option to force anniversary packages to prorate, #38191
[freeside.git]
/
FS
/
FS
/
part_pkg
/
prorate_calendar.pm
diff --git
a/FS/FS/part_pkg/prorate_calendar.pm
b/FS/FS/part_pkg/prorate_calendar.pm
index
c50cae0
..
a8ed8f9
100644
(file)
--- a/
FS/FS/part_pkg/prorate_calendar.pm
+++ b/
FS/FS/part_pkg/prorate_calendar.pm
@@
-72,7
+72,11
@@
sub check {
sub cutoff_day {
my( $self, $cust_pkg ) = @_;
my @periods = @{ $freq_cutoff_days{$self->freq} };
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] + $_;
pop @periods; # we don't care about the last one
foreach (@periods) {
push @cutoffs, $cutoffs[-1] + $_;