X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcdr%2Forcon.pm;h=66b045fd5f85c46024896a737ec1785da3ab7bfa;hb=9573631ec3299ced290115ca0cb71690917bb7e2;hp=4d15cfdf3b8e0344566d137a0a734cb8452c0e2c;hpb=94f53394be8a214aefda3e2ce3e25b3fcd87fc93;p=freeside.git diff --git a/FS/FS/cdr/orcon.pm b/FS/FS/cdr/orcon.pm index 4d15cfdf3..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,12 +13,27 @@ 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 - 'calldate', #date + sub { my ($cdr, $calldate, $param) = @_; + + $cdr->set('calldate', $calldate); + + 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 'dst', #terminating number