X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcdr%2Forcon.pm;h=66b045fd5f85c46024896a737ec1785da3ab7bfa;hb=b8d0732eb99b96fa0cc932e74ede5799d6ff71bc;hp=51ef9ea55cd6fb82108562c132f53be758dd4323;hpb=dd671563e488044645ab388468f7b2f82fb15fc4;p=freeside.git diff --git a/FS/FS/cdr/orcon.pm b/FS/FS/cdr/orcon.pm index 51ef9ea55..66b045fd5 100644 --- a/FS/FS/cdr/orcon.pm +++ b/FS/FS/cdr/orcon.pm @@ -3,6 +3,7 @@ package FS::cdr::orcon; use strict; use vars qw( @ISA %info); use FS::cdr; +use Date::Parse; @ISA = qw(FS::cdr); @@ -12,20 +13,26 @@ use FS::cdr; 'header' => 1, 'import_fields' => [ - skip(2), #id - #billing period + skip(1) , #id + skip(1) , #billing period 'accountcode', #account number skip(2), #username #service id - sub { my ($cdr, $calldate) = @_; + sub { my ($cdr, $calldate, $param) = @_; + $cdr->set('calldate', $calldate); - $calldate =~ /^(\d{2})\/(\d{2})\/(\d{4})\s*(\d{2}):(\d{2}):(\d{2})$/ - or die "unparseable date: $calldate"; - my $tmp_date = "$2/$1/$3 $4:$5:$6"; + if ($calldate =~ /^(\d{4})-(\d{2})-(\d{2})\s*(\d{2}):(\d{2}):(\d{2})$/){ + + my $tmp_date = "$2/$3/$1 $4:$5:$6"; $tmp_date = str2time($tmp_date); $cdr->set('startdate', $tmp_date); + + } else { + + $param->{skiprow} = 1 + } }, #date skip(1), #tariff region 'src', #originating number