[freeside-commits] branch FREESIDE_2_3_BRANCH updated. 59d2b76f21d930235e7cde6822be8d338a26b777

Ivan ivan at 420.am
Mon May 13 14:19:10 PDT 2013


The branch, FREESIDE_2_3_BRANCH has been updated
       via  59d2b76f21d930235e7cde6822be8d338a26b777 (commit)
      from  b24f2ed54a7aad4772a6d7c04035887f59fb3fe2 (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 59d2b76f21d930235e7cde6822be8d338a26b777
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon May 13 14:19:09 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 36947ad..10b2b81 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -837,6 +837,13 @@ my @cdr_formats = (
   },
 
   {
+    '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 4054c2f..5424db5 100644
--- a/FS/FS/part_pkg.pm
+++ b/FS/FS/part_pkg.pm
@@ -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;

-----------------------------------------------------------------------

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