[freeside-commits] branch master updated. 470878235c5f61ca7acc6ef618943071ca9736b5

Mark Wells mark at 420.am
Mon Apr 13 15:47:21 PDT 2015


The branch, master has been updated
       via  470878235c5f61ca7acc6ef618943071ca9736b5 (commit)
      from  b9480e431289b01d37c8206df4285d311cf2c0e8 (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 470878235c5f61ca7acc6ef618943071ca9736b5
Author: Mark Wells <mark at freeside.biz>
Date:   Mon Apr 13 15:47:09 2015 -0700

    during scheduled package changes, keep setup and bill dates, #30223

diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index eaadd95..3e87aad 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -2025,6 +2025,7 @@ sub change {
 
   my $unused_credit = 0;
   my $keep_dates = $opt->{'keep_dates'};
+
   # Special case.  If the pkgpart is changing, and the customer is
   # going to be credited for remaining time, don't keep setup, bill, 
   # or last_bill dates, and DO pass the flag to cancel() to credit 
@@ -2085,6 +2086,15 @@ sub change {
       $cust_pkg->set("change_$_", $self->get($_));
     }
     $cust_pkg->set('change_date', $time);
+    $cust_pkg->set('start_date', ''); # it's starting now
+    # if we are crediting unused time, then create the new package as a new
+    # package, charge its setup fee, etc. (same as an immediate change)
+    if (! $unused_credit) {
+      foreach my $date ( qw(setup bill last_bill susp adjourn resume 
+                            contract_end ) ) {
+        $cust_pkg->set($date, $self->getfield($date));
+      }
+    }
     $error = $cust_pkg->replace;
 
   } else {

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

Summary of changes:
 FS/FS/cust_pkg.pm |   10 ++++++++++
 1 file changed, 10 insertions(+)




More information about the freeside-commits mailing list