X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fshellcommands.pm;h=647dc5f4d364696ee8813a17704008969c2bec14;hb=9fa1bf13b76c0177a3aa12d70aabe5358a9fa3e5;hp=ce136951034e971f6fc236362134f05659f06694;hpb=3d0a1bb06b895c5be6e3f0517d355442a6b1e125;p=freeside.git diff --git a/FS/FS/part_export/shellcommands.pm b/FS/FS/part_export/shellcommands.pm index ce1369510..647dc5f4d 100644 --- a/FS/FS/part_export/shellcommands.pm +++ b/FS/FS/part_export/shellcommands.pm @@ -208,6 +208,7 @@ old_ for replace operations):
  • $reasontypenum (when suspending)
  • $reasontypetext (when suspending)
  • $pkgnum +
  • $locationnum
  • $custnum
  • All other fields in svc_acct are also available.
  • The following fields from cust_main are also available (except during replace): company, address1, address2, city, state, zip, county, daytime, night, fax, otaker, agent_custid, locale. When used on the command line (rather than STDIN), they will be quoted for the shell already (do not add additional quotes). @@ -267,17 +268,19 @@ sub export_pkg_change { my @fields = qw( pkgnum pkgpart agent_pkgid ); #others? my @date_fields = qw( order_date start_date setup bill last_bill susp adjourn - resume cancel uncancel expore contract_end ); + resume cancel uncancel expire contract_end ); no strict 'vars'; { no strict 'refs'; foreach (@fields) { - ${"old_$_"} = $old_cust_pkg->getfield($_); + ${"old_$_"} = $old_cust_pkg ? $old_cust_pkg->getfield($_) : ''; ${"new_$_"} = $new_cust_pkg->getfield($_); } foreach (@date_fields) { - ${"old_$_"} = time2str('%Y-%m-%d', $old_cust_pkg->getfield($_)); + ${"old_$_"} = $old_cust_pkg + ? time2str('%Y-%m-%d', $old_cust_pkg->getfield($_)) + : ''; ${"new_$_"} = time2str('%Y-%m-%d', $new_cust_pkg->getfield($_)); } } @@ -380,6 +383,7 @@ sub _export_command { } $pkgnum = $cust_pkg ? $cust_pkg->pkgnum : ''; + $locationnum = $cust_pkg ? $cust_pkg->locationnum : ''; $custnum = $cust_pkg ? $cust_pkg->custnum : ''; my $stdin_string = eval(qq("$stdin")); @@ -489,8 +493,10 @@ sub _export_replace { $new_agent_custid = $new_cust_main ? $new_cust_main->agent_custid : ''; $new_locale = $new_cust_main ? $new_cust_main->locale : ''; $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 : ''; my $stdin_string = eval(qq("$stdin"));