summaryrefslogtreecommitdiff
path: root/FS/FS/part_pkg/subscription.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2016-10-14 12:04:59 -0700
committerMark Wells <mark@freeside.biz>2016-10-14 12:04:59 -0700
commit70b73a5ac0a7930b7413ea7de4e82dd0e3e27cbe (patch)
tree0bcd42bc5037e7b4a3fcb1c8af07939e356294a1 /FS/FS/part_pkg/subscription.pm
parenta21d7f250e6bd12228e5d0d312a646bd8b03f546 (diff)
per-customer option to force anniversary packages to prorate, #38191
Diffstat (limited to 'FS/FS/part_pkg/subscription.pm')
-rw-r--r--FS/FS/part_pkg/subscription.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/FS/FS/part_pkg/subscription.pm b/FS/FS/part_pkg/subscription.pm
index 0dfe049..bf644d4 100644
--- a/FS/FS/part_pkg/subscription.pm
+++ b/FS/FS/part_pkg/subscription.pm
@@ -88,6 +88,11 @@ use FS::part_pkg::flat;
sub calc_recur {
my($self, $cust_pkg, $sdate, $details, $param ) = @_;
my $cutoff_day = $self->option('cutoff_day', 1) || 1;
+ my $cust_main = $cust_pkg->cust_main;
+ if ( $cust_main->force_prorate_day and $cust_main->prorate_day ) {
+ $cutoff_day = $cust_main->prorate_day;
+ }
+
my $mnow = $$sdate;
my ($sec,$min,$hour,$mday,$mon,$year) = (localtime($mnow) )[0,1,2,3,4,5];