diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2012-12-20 10:59:06 -0800 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2012-12-20 10:59:06 -0800 |
| commit | dfb703365f0561bdf5ad01b677eca7a90cda52cf (patch) | |
| tree | 9d685a4b53225651defc83415417e548ff0fa1e0 | |
| parent | 163bc5b77d302447d3f1126185af9a798727562e (diff) | |
add pkgnum var to phone_shellcommands export, RT#20725
| -rw-r--r-- | FS/FS/part_export/phone_shellcommands.pm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/FS/FS/part_export/phone_shellcommands.pm b/FS/FS/part_export/phone_shellcommands.pm index 040af27a7..d74dcb9d2 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): <LI><code>$sip_password</code> - SIP secret (quoted for the shell) <LI><code>$pin</code> - Personal identification number <LI><code>$cust_name</code> - Customer name (quoted for the shell) + <LI><code>$pkgnum</code> - Internal package number </UL> 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 |
