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