[freeside-commits] branch master updated. eea8f640d0008d8b7a2987cc530cbec157cc652f

Mark Wells mark at 420.am
Tue Jul 10 14:55:44 PDT 2012


The branch, master has been updated
       via  eea8f640d0008d8b7a2987cc530cbec157cc652f (commit)
      from  35441752ed24a30b2ccba25db4322d9ddbc88f2d (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 eea8f640d0008d8b7a2987cc530cbec157cc652f
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Jul 10 14:55:18 2012 -0700

    fix uncancellation of services, from #17518

diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 627a7fc..6c78958 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -970,21 +970,25 @@ sub uncancel {
     }
 
     my $svc_error = $svc_x->insert;
-    if ( $svc_error && $options{svc_fatal} ) {
-      $dbh->rollback if $oldAutoCommit;
-      return $svc_error;
-    } else {
-      my $cust_svc = qsearchs('cust_svc', { 'svcnum' => $svc_x->svcnum });
-      if ( $cust_svc ) {
-        my $cs_error = $cust_svc->delete;
-        if ( $cs_error ) {
-          $dbh->rollback if $oldAutoCommit;
-          return $cs_error;
+    if ( $svc_error ) {
+      if ( $options{svc_fatal} ) {
+        $dbh->rollback if $oldAutoCommit;
+        return $svc_error;
+      } else {
+        push @svc_errors, $svc_error;
+        # is this necessary? svc_Common::insert already deletes the 
+        # cust_svc if inserting svc_x fails.
+        my $cust_svc = qsearchs('cust_svc', { 'svcnum' => $svc_x->svcnum });
+        if ( $cust_svc ) {
+          my $cs_error = $cust_svc->delete;
+          if ( $cs_error ) {
+            $dbh->rollback if $oldAutoCommit;
+            return $cs_error;
+          }
         }
-      }
-    }
-    push @svc_errors, $svc_error if $svc_error;
-  }
+      } # svc_fatal
+    } # svc_error
+  } #foreach $h_cust_svc
 
   #these are pretty rare, but should handle them
   # - dsl_device (mac addresses)

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

Summary of changes:
 FS/FS/cust_pkg.pm |   32 ++++++++++++++++++--------------
 1 files changed, 18 insertions(+), 14 deletions(-)




More information about the freeside-commits mailing list