[freeside-commits] branch master updated. e498e76c74a2e65e1c0b6a5514130ff71cee8a5b

Jonathan Prykop jonathan at 420.am
Tue Apr 19 10:16:43 PDT 2016


The branch, master has been updated
       via  e498e76c74a2e65e1c0b6a5514130ff71cee8a5b (commit)
      from  b7f8a7cfd566881a6d89117d17e391ceb58097d4 (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 e498e76c74a2e65e1c0b6a5514130ff71cee8a5b
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Tue Apr 19 12:16:15 2016 -0500

    RT#29296: API stuff: Add new locations [API bug fixes]

diff --git a/FS/FS/API.pm b/FS/FS/API.pm
index 77ae03b..1c4cbd9 100644
--- a/FS/FS/API.pm
+++ b/FS/FS/API.pm
@@ -589,7 +589,7 @@ containing the new values.
 =cut
 
 sub change_package_location {
-  my $self = shift;
+  my $class = shift;
   my %opt  = @_;
   return _shared_secret_error() unless _check_shared_secret($opt{'secret'});
 
@@ -597,13 +597,10 @@ sub change_package_location {
     or return { 'error' => 'Unknown pkgnum' };
 
   my %changeopt;
-  $changeopt{'pkgnum'} = $pkgnum;
 
-  my $cust_location = FS::cust_location->new({
-    'custnum' => $cust_pkg->custnum,
-    %location_hash,
-  });
-  $changeopt{'cust_location'} = $cust_location;
+  foreach my $field ('locationnum',FS::cust_location::API::API_editable_fields()) {
+    $changeopt{$field} = $opt{$field} if $opt{$field};
+  }
 
   $cust_pkg->API_change(%changeopt);
 }
diff --git a/FS/FS/cust_pkg/API.pm b/FS/FS/cust_pkg/API.pm
index 6e03b8e..7ef3f72 100644
--- a/FS/FS/cust_pkg/API.pm
+++ b/FS/FS/cust_pkg/API.pm
@@ -19,7 +19,7 @@ sub API_change {
   my %opt = @_;
 
   return { 'error' => 'Cannot change canceled package' }
-    if $self->cancel;
+    if $self->get('cancel');
 
   my %changeopt;
 

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

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




More information about the freeside-commits mailing list