X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=bin%2Fcdr.sftp_and_import;h=79e743f39eab1f89e056acf044ff8539155a1840;hb=fa1ac68bf90cb9582f239bce31db157ec2719f43;hp=f68d70c7689d9f9bf2066a611a9c5446c59b43bc;hpb=c47123a101c99b35c3c7b1be5b003b773ae00e06;p=freeside.git diff --git a/bin/cdr.sftp_and_import b/bin/cdr.sftp_and_import index f68d70c76..79e743f39 100755 --- a/bin/cdr.sftp_and_import +++ b/bin/cdr.sftp_and_import @@ -16,8 +16,8 @@ use FS::cdr; # parse command line ### -use vars qw( $opt_e $opt_d $opt_u $opt_v ); -getopts('e:d:u:v'); +use vars qw( $opt_e $opt_d $opt_v ); +getopts('e:d:v'); $opt_e ||= 'csv'; #$opt_e = ".$opt_e" unless $opt_e =~ /^\./; @@ -61,13 +61,11 @@ foreach my $file ( @$ls ) { warn "Processing $filename\n" if $opt_v; - open(FILE, "$cachedir/$filename") or die "can't read $cachedir/$filename: $!"; - my $error = FS::cdr::batch_import( { - 'filehandle' => *FILE{IO}, - 'format' => $format, - 'cdrbatch' => $filename, - 'empty_ok' => 1, + 'file' => "$cachedir/$filename" + 'format' => $format, + 'params' => { 'cdrbatch' => $filename, }, + 'empty_ok' => 1, } ); die $error if $error;