X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_svc.pm;h=8fc929f29c6ce7c983311c3380489a9f66b1db19;hp=b01ed8459e362a8d16ad2b11e33abe5745df94b5;hb=fa978560e3b0473728ebf2fb32625765465c230a;hpb=3e3441036353ea99dc85548bbdbe810edc81b181 diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm index b01ed8459..8fc929f29 100644 --- a/FS/FS/cust_svc.pm +++ b/FS/FS/cust_svc.pm @@ -322,14 +322,24 @@ sub replace { my $error = $new->svc_x->export('pkg_change', $new->cust_pkg, $old->cust_pkg, ); + if ( $error ) { $dbh->rollback if $oldAutoCommit; return $error if $error; } - } + } # if pkgnum is changing #my $error = $new->SUPER::replace($old, @_); my $error = $new->SUPER::replace($old); + + #trigger a relocate export on location changes + if ( $new->cust_pkg->locationnum != $old->cust_pkg->locationnum ) { + $error ||= $new->svc_x->export('relocate', + $new->cust_pkg->cust_location, + $old->cust_pkg->cust_location, + ); + } + if ( $error ) { $dbh->rollback if $oldAutoCommit; return $error if $error;