[freeside-commits] branch FREESIDE_3_BRANCH updated. af68f26e1a7c15fa506e38393aac95c4e572928e

Mark Wells mark at 420.am
Mon Jan 27 13:27:06 PST 2014


The branch, FREESIDE_3_BRANCH has been updated
       via  af68f26e1a7c15fa506e38393aac95c4e572928e (commit)
      from  8a31f9fec781bca37c15412928b9b4b16940d2fa (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 af68f26e1a7c15fa506e38393aac95c4e572928e
Author: Mark Wells <mark at freeside.biz>
Date:   Mon Jan 27 13:26:49 2014 -0800

    even better error messages, #27194

diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 12a0c40..81ada45 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -3567,6 +3567,7 @@ sub transfer {
     }
   }
 
+  my $error;
   foreach my $cust_svc ($self->cust_svc) {
     my $svcnum = $cust_svc->svcnum;
     if($target{$cust_svc->svcpart} > 0
@@ -3574,8 +3575,7 @@ sub transfer {
       $target{$cust_svc->svcpart}--;
       my $new = new FS::cust_svc { $cust_svc->hash };
       $new->pkgnum($dest_pkgnum);
-      my $error = $new->replace($cust_svc);
-      return "svcnum $svcnum: $error" if $error;
+      $error = $new->replace($cust_svc);
     } elsif ( exists $opt{'change_svcpart'} && $opt{'change_svcpart'} ) {
       if ( $DEBUG ) {
         warn "looking for alternates for svcpart ". $cust_svc->svcpart. "\n";
@@ -3595,14 +3595,17 @@ sub transfer {
         my $new = new FS::cust_svc { $cust_svc->hash };
         $new->svcpart($change_svcpart);
         $new->pkgnum($dest_pkgnum);
-        my $error = $new->replace($cust_svc);
-        return "svcnum $svcnum: $error" if $error;
+        $error = $new->replace($cust_svc);
       } else {
         $remaining++;
       }
     } else {
       $remaining++
     }
+    if ( $error ) {
+      my @label = $cust_svc->label;
+      return "service $label[1]: $error";
+    }
   }
   return $remaining;
 }

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

Summary of changes:
 FS/FS/cust_pkg.pm |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)




More information about the freeside-commits mailing list