summaryrefslogtreecommitdiff
path: root/FS/FS/cust_svc.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-06-26 15:47:22 -0700
committerMark Wells <mark@freeside.biz>2014-06-26 16:04:51 -0700
commitfa978560e3b0473728ebf2fb32625765465c230a (patch)
tree07f90f1a1980f0f1fee00ad736a4b1adb5ca723e /FS/FS/cust_svc.pm
parent3e3441036353ea99dc85548bbdbe810edc81b181 (diff)
NENA2 E911 export and batch-oriented exports in general, #14049
Diffstat (limited to 'FS/FS/cust_svc.pm')
-rw-r--r--FS/FS/cust_svc.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm
index b01ed84..8fc929f 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;