X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FAPI.pm;h=4ff1a3ab592c61d28cdd6dd4c5e959be9f8437ce;hb=039d72ae9e7adf98f46c3b4219100d57208c3685;hp=f9f28c12e210a34873fe3b57d9844f7cc504de53;hpb=94cdf97cf0a14a433c81c44bbeb76bf953db2dcc;p=freeside.git diff --git a/FS/FS/API.pm b/FS/FS/API.pm index f9f28c12e..4ff1a3ab5 100644 --- a/FS/FS/API.pm +++ b/FS/FS/API.pm @@ -65,6 +65,10 @@ Amount paid Option date for payment +=item order_number + +Optional order number + =back Example: @@ -77,6 +81,7 @@ Example: #optional '_date' => 1397977200, #UNIX timestamp + 'order_number' => '12345', ); if ( $result->{'error'} ) { @@ -755,6 +760,8 @@ secret locationnum - pass this, or the following keys (don't pass both) +locationname + address1 address2 @@ -767,8 +774,22 @@ state zip +addr_clean + country +censustract + +censusyear + +location_type + +location_number + +location_kind + +incorporated + On error, returns a hashref with an 'error' key. On success, returns a hashref with 'pkgnum' and 'locationnum' keys, containing the new values. @@ -776,7 +797,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 +805,27 @@ 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 ( qw( + locationnum + locationname + address1 + address2 + city + county + state + zip + addr_clean + country + censustract + censusyear + location_type + location_number + location_kind + incorporated + )) { + $changeopt{$field} = $opt{$field} if $opt{$field}; + } $cust_pkg->API_change(%changeopt); }