X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcdr.pm;h=36721a81adf8fa426880f7cd8ef0371677bc9551;hb=b79a8cb932946c849328a3c117c35821d9d21e66;hp=0107659a86322ce1fa58a726fc15c54f194afc61;hpb=158103c8701d8cd87148c579dc101979c808b8c2;p=freeside.git diff --git a/FS/FS/cdr.pm b/FS/FS/cdr.pm index 0107659a8..36721a81a 100644 --- a/FS/FS/cdr.pm +++ b/FS/FS/cdr.pm @@ -911,7 +911,7 @@ my %import_options = ( }, #drop the || 'csv' to allow auto xls for csv types? - 'format_types' => { map { $_ => ( lc($cdr_info{$_}->{'type'}) || 'csv' ); } + 'format_types' => { map { $_ => lc($cdr_info{$_}->{'type'} || 'csv'); } keys %cdr_info }, @@ -948,6 +948,14 @@ sub batch_import { my $iopt = _import_options; $opt->{$_} = $iopt->{$_} foreach keys %$iopt; + if ( defined $opt->{'cdrtypenum'} ) { + $opt->{'preinsert_callback'} = sub { + my($record,$param) = (shift,shift); + $record->cdrtypenum($opt->{'cdrtypenum'}); + ''; + }; + } + FS::Record::batch_import( $opt ); }