X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=FS%2FFS%2Fpart_export%2Fphone_shellcommands.pm;h=9ace2135541648612da1397acc71d2ce3bc78ee0;hb=71cfb409fca5c4f8cfb639a0f022de8c640b7775;hp=040af27a7a3f3e08ffbc001f3544f60196f041fa;hpb=b5c4237a34aef94976bc343c8d9e138664fc3984;p=freeside.git diff --git a/FS/FS/part_export/phone_shellcommands.pm b/FS/FS/part_export/phone_shellcommands.pm index 040af27a7..9ace21355 100644 --- a/FS/FS/part_export/phone_shellcommands.pm +++ b/FS/FS/part_export/phone_shellcommands.pm @@ -49,6 +49,7 @@ old_ for replace operations):
  • $sip_password - SIP secret (quoted for the shell)
  • $pin - Personal identification number
  • $cust_name - Customer name (quoted for the shell) +
  • $pkgnum - Internal package number END ); @@ -87,6 +88,7 @@ sub _export_command { ${$_} = $svc_phone->getfield($_) foreach $svc_phone->fields; } my $cust_pkg = $svc_phone->cust_svc->cust_pkg; + my $pkgnum = $cust_pkg ? $cust_pkg->pkgnum : ''; my $cust_name = $cust_pkg ? $cust_pkg->cust_main->name : ''; $cust_name = shell_quote $cust_name; my $sip_password = shell_quote $svc_phone->sip_password; @@ -111,7 +113,10 @@ sub _export_replace { ${"new_$_"} = $new->getfield($_) foreach $new->fields; } + my $old_cust_pkg = $old->cust_svc->cust_pkg; + my $old_pkgnum = $old_cust_pkg ? $old_cust_pkg->pkgnum : ''; my $cust_pkg = $new->cust_svc->cust_pkg; + my $new_pkgnum = $cust_pkg ? $cust_pkg->pkgnum : ''; my $new_cust_name = $cust_pkg ? $cust_pkg->cust_main->name : ''; $new_cust_name = shell_quote $new_cust_name; #done setting variables for the command @@ -138,3 +143,4 @@ sub ssh_cmd { #subroutine, not method &Net::SSH::ssh_cmd( { @_ } ); } +1;