X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fbroadband_shellcommands.pm;h=44280a2009041ad2bca5b7691f4b73f6b2dcb81e;hb=e92c3b71a6182bdca0831ca4755ae0127e7e5180;hp=b57267ec5520a722ca4198b4ad4600055dfaee13;hpb=3d0a1bb06b895c5be6e3f0517d355442a6b1e125;p=freeside.git
diff --git a/FS/FS/part_export/broadband_shellcommands.pm b/FS/FS/part_export/broadband_shellcommands.pm
index b57267ec5..44280a200 100644
--- a/FS/FS/part_export/broadband_shellcommands.pm
+++ b/FS/FS/part_export/broadband_shellcommands.pm
@@ -37,8 +37,8 @@ tie my %options, 'Tie::IxHash',
'notes' => <<'END'
Run remote commands via SSH, for broadband services.
-All fields in svc_broadband are available for interpolation (prefixed with
-new_
or old_
for replace operations).
+All fields in svc_broadband are available for interpolation, as well as pkgnum, locationnum and custnum (prefixed with new_
or old_
+for replace operations).
END
);
@@ -80,6 +80,11 @@ sub _export_command {
$mac_addr = uc $mac_addr
if $self->option('uppercase_mac');
+ my $cust_pkg = $svc_broadband->cust_svc->cust_pkg;
+ $pkgnum = $cust_pkg ? $cust_pkg->pkgnum : '';
+ $locationnum = $cust_pkg ? $cust_pkg->locationnum : '';
+ $custnum = $cust_pkg ? $cust_pkg->custnum : '';
+
#done setting variables for the command
$self->shellcommands_queue( $svc_broadband->svcnum,
@@ -106,6 +111,15 @@ sub _export_replace {
$new_mac_addr = uc $new_mac_addr;
}
+ my $old_cust_pkg = $old->cust_svc->cust_pkg;
+ my $new_cust_pkg = $new->cust_svc->cust_pkg;
+ $old_pkgnum = $old_cust_pkg ? $old_cust_pkg->pkgnum : '';
+ $old_locationnum = $old_cust_pkg ? $old_cust_pkg->locationnum : '';
+ $old_custnum = $old_cust_pkg ? $old_cust_pkg->custnum : '';
+ $new_pkgnum = $new_cust_pkg ? $new_cust_pkg->pkgnum : '';
+ $new_locationnum = $new_cust_pkg ? $new_cust_pkg->locationnum : '';
+ $new_custnum = $new_cust_pkg ? $new_cust_pkg->custnum : '';
+
#done setting variables for the command
$self->shellcommands_queue( $new->svcnum,