[freeside-commits] branch FREESIDE_3_BRANCH updated. 0b5ea482d5cb6685d3866a8940dc90eb6e8157cf

Mark Wells mark at 420.am
Sat Feb 28 13:21:51 PST 2015


The branch, FREESIDE_3_BRANCH has been updated
       via  0b5ea482d5cb6685d3866a8940dc90eb6e8157cf (commit)
      from  fe708edd0ced9686d96b3ceb3de1300f5984a92e (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 0b5ea482d5cb6685d3866a8940dc90eb6e8157cf
Author: Mark Wells <mark at freeside.biz>
Date:   Sat Feb 28 13:14:57 2015 -0800

    change interaction between unsuspend_adjust_bill and unused_credit_suspend, #31651

diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 40f3a4e..3c9eab8 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -1676,15 +1676,20 @@ sub unsuspend {
            and ! $self->option('no_suspend_bill',1)
          )
       or $hash{'order_date'} == $hash{'susp'}
-      or $self->part_pkg->option('unused_credit_suspend')
-      or ( defined($reason) and $reason->unused_credit )
   ) {
     $adjust_bill = 0;
   }
 
-  # then add the length of time suspended to the bill date
   if ( $adjust_bill ) {
-    $hash{'bill'} = ( $hash{'bill'} || $hash{'setup'} ) + $inactive
+    if (    $self->part_pkg->option('unused_credit_suspend')
+         or ( $reason and $reason->unused_credit ) ) {
+      # then the customer was credited for the unused time before suspending,
+      # so their next bill should be immediate.
+      $hash{'bill'} = time;
+    } else {
+      # add the length of time suspended to the bill date
+      $hash{'bill'} = ( $hash{'bill'} || $hash{'setup'} ) + $inactive;
+    }
   }
 
   $hash{'susp'} = '';

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

Summary of changes:
 FS/FS/cust_pkg.pm |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)




More information about the freeside-commits mailing list