X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FAPI.pm;h=5db29b2b5a678a739ec4cdb622756334402b58dc;hp=f9f28c12e210a34873fe3b57d9844f7cc504de53;hb=70ff8d2c5f32a674d4ae75c8f018e630033ed645;hpb=94cdf97cf0a14a433c81c44bbeb76bf953db2dcc diff --git a/FS/FS/API.pm b/FS/FS/API.pm index f9f28c12e..5db29b2b5 100644 --- a/FS/FS/API.pm +++ b/FS/FS/API.pm @@ -776,7 +776,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'}); @@ -784,13 +784,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); }