1 package FS::cdr::simple;
4 use vars qw( @ISA %info $tmp_mon $tmp_mday $tmp_year );
6 use FS::cdr qw(_cdr_min_parser_maker);
17 sub { my($cdr, $date) = @_;
18 $date =~ /^(\d{1,2})\/(\d{1,2})\/(\d\d(\d\d)?)$/
19 or die "unparsable date: $date"; #maybe we shouldn't die...
20 #$cdr->startdate( timelocal(0, 0, 0 ,$2, $1-1, $3) );
21 ($tmp_mday, $tmp_mon, $tmp_year) = ( $2, $1-1, $3 );
25 sub { my($cdr, $time) = @_;
26 #my($sec, $min, $hour, $mday, $mon, $year)= localtime($cdr->startdate);
27 $time =~ /^(\d{1,2}):(\d{1,2}):(\d{1,2})$/
28 or die "unparsable time: $time"; #maybe we shouldn't die...
29 #$cdr->startdate( timelocal($3, $2, $1 ,$mday, $mon, $year) );
31 timelocal($3, $2, $1 ,$tmp_mday, $tmp_mon, $tmp_year)
42 _cdr_min_parser_maker, #( [qw( billsec duration)] ),
43 #sub { my($cdr, $min) = @_;
44 # my $sec = sprintf('%.0f', $min * 60 );
45 # $cdr->billsec( $sec );
46 # $cdr->duration( $sec );