1 package FS::cdr::troop2;
4 use base qw( FS::cdr );
5 use vars qw( %info $tmp_mon $tmp_mday $tmp_year $tmp_src_city $tmp_dst_city );
7 ##use FS::cdr qw( _cdr_date_parser_maker _cdr_min_parser_maker );
19 'userfield', #account_num (userfield?)
21 # XXX false laziness w/bell_west.pm
23 sub { my($cdr, $date) = @_;
25 my $datetime = DateTime::Format::Excel->parse_datetime( $date );
26 $tmp_mon = $datetime->mon_0;
27 $tmp_mday = $datetime->mday;
28 $tmp_year = $datetime->year;
32 sub { my($cdr, $time) = @_;
33 #my($sec, $min, $hour, $mday, $mon, $year)= localtime($cdr->startdate);
35 #$sec = $time * 86400;
36 my $sec = int( $time * 86400 + .5);
38 #$cdr->startdate( timelocal($3, $2, $1 ,$mday, $mon, $year) );
40 timelocal(0, 0, 0, $tmp_mday, $tmp_mon, $tmp_year) + $sec
48 sub { my($cdr, $duration) = @_;
49 $cdr->duration($duration);
50 $cdr->billsec($duration);
53 'clid', #auth_code_ani (clid?)
55 'accountcode', #account_code
58 # OVS Type / Maybe / add "011" to international calls
63 sub { my($cdr, $ovs) = @_;
64 my $pre = ( $ovs =~ /^\s*[OZ]\s*$/i ) ? '011' : '1';
65 $cdr->dst( $pre. $cdr->dst ) unless $cdr->dst =~ /^$pre/;
69 sub { (my $cdr, $tmp_src_city) = @_; },
72 sub { my($cdr, $state) = @_;
73 $cdr->upstream_src_regionname("$tmp_src_city, $state");
77 sub { (my $cdr, $tmp_dst_city) = @_; },
80 sub { my($cdr, $state) = @_;
81 $cdr->upstream_dst_regionname("$tmp_dst_city, $state");
85 '', #CANADA / UNITED STATES / BELL. huh. country or terminating provider?
87 '', #cc_ind (what's this?)
89 'upstream_price', #call_charge
95 #additional upstream pricing details we don't need?