[freeside-commits] branch master updated. 5cb958cb932ef9582e9b0e542de280f2bf26197c

Jonathan Prykop jonathan at 420.am
Mon Feb 16 13:31:26 PST 2015


The branch, master has been updated
       via  5cb958cb932ef9582e9b0e542de280f2bf26197c (commit)
      from  7b40e0e045368d350529d78208be0e6124f94b5a (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 5cb958cb932ef9582e9b0e542de280f2bf26197c
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Mon Feb 16 15:30:37 2015 -0600

    RT#14671: Usage for current day when billing outstanding usage (for cancelling customers) [better supplemental package handling]

diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 0cb6209..7678a02 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -935,7 +935,11 @@ sub cancel {
   }
 
   foreach my $supp_pkg ( $self->supplemental_pkgs ) {
-    $error = $supp_pkg->cancel(%options, 'from_main' => 1);
+    if ($delay_cancel) {
+        $error = $supp_pkg->suspend(%options, 'from_main' => 1, 'reason' => undef);
+    } else {
+        $error = $supp_pkg->cancel(%options, 'from_main' => 1);
+    }
     if ( $error ) {
       $dbh->rollback if $oldAutoCommit;
       return "canceling supplemental pkg#".$supp_pkg->pkgnum.": $error";
diff --git a/FS/FS/part_pkg_link.pm b/FS/FS/part_pkg_link.pm
index 2460e99..aee0131 100644
--- a/FS/FS/part_pkg_link.pm
+++ b/FS/FS/part_pkg_link.pm
@@ -260,11 +260,6 @@ sub check {
                ") must be an integer multiple of main package period.";
       }
     }
-    if (( $src_pkg->option('delay_cancel',1) && !$dst_pkg->option('delay_cancel',1) ) ||
-        ( $dst_pkg->option('delay_cancel',1) && !$src_pkg->option('delay_cancel',1) )
-    ) {
-      return "Supplemental package must have same value as main package for automatic suspension on cancel.";
-    }
   }
 
   $self->SUPER::check;

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

Summary of changes:
 FS/FS/cust_pkg.pm      |    6 +++++-
 FS/FS/part_pkg_link.pm |    5 -----
 2 files changed, 5 insertions(+), 6 deletions(-)




More information about the freeside-commits mailing list