add anniversary-rollback option to roll the anniversary date back to the 28th instead...
[freeside.git] / FS / FS / part_pkg.pm
index 4054c2f..5424db5 100644 (file)
@@ -927,6 +927,9 @@ sub add_freq {
   if ( $freq =~ /^\d+$/ ) {
     $mon += $freq;
     until ( $mon < 12 ) { $mon -= 12; $year++; }
+
+    $mday = 28 if $mday > 28 && FS::Conf->new->exists('anniversary-rollback');
+
   } elsif ( $freq =~ /^(\d+)w$/ ) {
     my $weeks = $1;
     $mday += $weeks * 7;