X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fshellcommands.pm;h=f7e86514b183401bc4398a7a6ddc9da8c1d258c2;hb=e7624ae1dd0093e4afef2356500fbd033ea43da8;hp=ce136951034e971f6fc236362134f05659f06694;hpb=1f4450a6ca5746c8ac2bb7b95f42db66e277f77b;p=freeside.git diff --git a/FS/FS/part_export/shellcommands.pm b/FS/FS/part_export/shellcommands.pm index ce1369510..f7e86514b 100644 --- a/FS/FS/part_export/shellcommands.pm +++ b/FS/FS/part_export/shellcommands.pm @@ -267,17 +267,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($_)); } }