X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=FS%2FFS%2Fcust_svc.pm;h=4c38aae245fda2813b0f19d0965fc77699ff0961;hb=acc311a412cd8660572eb6de6712a1e0b2768ec1;hp=7e34f7dabd80717c054a976867ec63763880f73e;hpb=e27a48a0a49737055b3b7b7d21ec9760c75add61;p=freeside.git diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm index 7e34f7dab..4c38aae24 100644 --- a/FS/FS/cust_svc.pm +++ b/FS/FS/cust_svc.pm @@ -323,14 +323,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;