[freeside-commits] branch FREESIDE_3_BRANCH updated. c1f7dc4627e48b52e059c79fcae24873bec733da
Ivan
ivan at 420.am
Mon May 13 14:19:09 PDT 2013
The branch, FREESIDE_3_BRANCH has been updated
via c1f7dc4627e48b52e059c79fcae24873bec733da (commit)
from 1ab861a30013585eadb02bdef9e2fa073a67ee61 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c1f7dc4627e48b52e059c79fcae24873bec733da
Author: Ivan Kohler <ivan at freeside.biz>
Date: Mon May 13 14:19:08 2013 -0700
add anniversary-rollback option to roll the anniversary date back to the 28th instead of forward into the following month, RT#22723
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index d955f34..323bd22 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -866,6 +866,13 @@ sub reason_type_options {
},
{
+ 'key' => 'anniversary-rollback',
+ 'section' => 'billing',
+ 'description' => 'When billing an anniversary package ordered after the 28th, roll the anniversary date back to the 28th instead of forward into the following month.',
+ 'type' => 'checkbox',
+ },
+
+ {
'key' => 'encryption',
'section' => 'billing',
'description' => 'Enable encryption of credit cards and echeck numbers',
diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm
index e788269..605c84f 100644
--- a/FS/FS/part_pkg.pm
+++ b/FS/FS/part_pkg.pm
@@ -1081,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;
-----------------------------------------------------------------------
Summary of changes:
FS/FS/Conf.pm | 7 +++++++
FS/FS/part_pkg.pm | 3 +++
2 files changed, 10 insertions(+), 0 deletions(-)
More information about the freeside-commits
mailing list