X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg.pm;h=605c84f950ed3a585153d7974f1d7e85dff0d358;hb=d3c4fed49558ea5a99d379bf7e1cbefc8049d2d0;hp=40fb1dcb4170ff9dd9c5af6883188c30d14ce320;hpb=f0cd66efaddc221bdd2584eececd50a6953d5085;p=freeside.git diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index 40fb1dcb4..605c84f95 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -719,13 +719,14 @@ sub propagate { =item pkg_locale LOCALE Returns a customer-viewable string representing this package for the given -locale, from the part_pkg_msgcat table. If no localized string is found, -returns the base pkg field. +locale, from the part_pkg_msgcat table. If the given locale is empty or no +localized string is found, returns the base pkg field. =cut sub pkg_locale { my( $self, $locale ) = @_; + return $self->pkg unless $locale; my $part_pkg_msgcat = $self->part_pkg_msgcat($locale) or return $self->pkg; $part_pkg_msgcat->pkg; } @@ -1080,6 +1081,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;