[freeside-commits] branch FREESIDE_3_BRANCH updated. a0143763528c659487d677a88a41269c1a9a2802

Jonathan Prykop jonathan at 420.am
Wed Jun 29 22:23:12 PDT 2016


The branch, FREESIDE_3_BRANCH has been updated
       via  a0143763528c659487d677a88a41269c1a9a2802 (commit)
      from  ea4e037e3b3250815344e27e777d975f90a2f462 (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 a0143763528c659487d677a88a41269c1a9a2802
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Wed Jun 29 23:57:56 2016 -0500

    RT#33790: Proper handling for aborting a suspend/cancel

diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 30156b6..aa7cb4e 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -1273,14 +1273,15 @@ sub uncancel {
 
 =item unexpire
 
-Cancels any pending expiration (sets the expire field to null).
+Cancels any pending expiration (sets the expire field to null)
+for this package and any supplemental packages.
 
 If there is an error, returns the error, otherwise returns false.
 
 =cut
 
 sub unexpire {
-  my( $self, %options ) = @_;
+  my( $self ) = @_;
   my $error;
 
   local $SIG{HUP} = 'IGNORE';
@@ -1317,6 +1318,14 @@ sub unexpire {
     return $error;
   }
 
+  foreach my $supp_pkg ( $self->supplemental_pkgs ) {
+    $error = $supp_pkg->unexpire;
+    if ( $error ) {
+      $dbh->rollback if $oldAutoCommit;
+      return "unexpiring supplemental pkg#".$supp_pkg->pkgnum.": $error";
+    }
+  }
+
   $dbh->commit or die $dbh->errstr if $oldAutoCommit;
 
   ''; #no errors
@@ -1918,14 +1927,15 @@ sub unsuspend {
 
 =item unadjourn
 
-Cancels any pending suspension (sets the adjourn field to null).
+Cancels any pending suspension (sets the adjourn field to null)
+for this package and any supplemental packages.
 
 If there is an error, returns the error, otherwise returns false.
 
 =cut
 
 sub unadjourn {
-  my( $self, %options ) = @_;
+  my( $self ) = @_;
   my $error;
 
   local $SIG{HUP} = 'IGNORE';
@@ -1969,6 +1979,14 @@ sub unadjourn {
     return $error;
   }
 
+  foreach my $supp_pkg ( $self->supplemental_pkgs ) {
+    $error = $supp_pkg->unadjourn;
+    if ( $error ) {
+      $dbh->rollback if $oldAutoCommit;
+      return "unadjourning supplemental pkg#".$supp_pkg->pkgnum.": $error";
+    }
+  }
+
   $dbh->commit or die $dbh->errstr if $oldAutoCommit;
 
   ''; #no errors

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

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




More information about the freeside-commits mailing list