X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FAPI.pm;fp=FS%2FFS%2FAPI.pm;h=1c4cbd9af5e7190d2df51c0c8d34a01429349d21;hp=77ae03b10e746f005b64c08ce7da171e675b3d88;hb=e498e76c74a2e65e1c0b6a5514130ff71cee8a5b;hpb=b7f8a7cfd566881a6d89117d17e391ceb58097d4 diff --git a/FS/FS/API.pm b/FS/FS/API.pm index 77ae03b10..1c4cbd9af 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); }