From: Ivan Kohler Date: Fri, 1 Jul 2022 17:05:38 +0000 (-0700) Subject: fix manually setting cdrtypenum or carrierid to 0, RT#86028 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=86fb4649060ed26420bb1931481885064e76abc5 fix manually setting cdrtypenum or carrierid to 0, RT#86028 --- diff --git a/FS/bin/freeside-cdr-sftp_and_import b/FS/bin/freeside-cdr-sftp_and_import index bae805151..f2bf2944f 100755 --- a/FS/bin/freeside-cdr-sftp_and_import +++ b/FS/bin/freeside-cdr-sftp_and_import @@ -21,8 +21,8 @@ $opt_e =~ s/^\.//; $opt_p ||= ''; -die "invalid cdrtypenum" if $opt_c && $opt_c !~ /^\d+$/; -die "invalid carrierid" if $opt_i && $opt_i !~ /^\d+$/; +die "invalid cdrtypenum" if defined $opt_c && $opt_c !~ /^\d+$/; +die "invalid carrierid" if defined $opt_i && $opt_i !~ /^\d+$/; my %options = (); @@ -114,8 +114,8 @@ foreach my $filename ( @$ls ) { 'batch_namevalue' => $file_timestamp, 'empty_ok' => 1, }; - $import_options->{'cdrtypenum'} = $opt_c if $opt_c; - $import_options->{'carrierid'} = $opt_i if $opt_i; + $import_options->{'cdrtypenum'} = $opt_c if defined $opt_c; + $import_options->{'carrierid'} = $opt_i if defined $opt_i; my $error = FS::cdr::batch_import($import_options); @@ -164,7 +164,7 @@ foreach my $filename ( @$ls ) { sub usage { "Usage: - cdr.sftp_and_import [ -m method ] [ -p prefix ] [ -e extension ] + freeside-cdr-sftp_and_import [ -m method ] [ -p prefix ] [ -e extension ] [ -r remotefolder ] [ -d donefolder ] [ -v level ] [ -P port ] [ -a ] [ -g ] [ -s ] [ -c cdrtypenum ] user format [sftpuser@]servername ";