1 package FS::cdr::troop;
4 use base qw( FS::cdr );
5 use vars qw( %info $tmp_mon $tmp_mday $tmp_year );
7 #use FS::cdr qw( _cdr_date_parser_maker _cdr_min_parser_maker );
17 # CDR FIELD / REQUIRED / Notes
19 # / No / CDR sequence number
25 # Account Code / Yes / Account Code (security) and we need on invoice
28 # DT / Yes / "DATE" Excel
29 # XXX false laziness w/bell_west.pm
30 sub { my($cdr, $date) = @_;
32 my $datetime = DateTime::Format::Excel->parse_datetime( $date );
33 $tmp_mon = $datetime->mon_0;
34 $tmp_mday = $datetime->mday;
35 $tmp_year = $datetime->year;
38 # Time / Yes / "TIME" excel
39 sub { my($cdr, $time) = @_;
40 #my($sec, $min, $hour, $mday, $mon, $year)= localtime($cdr->startdate);
42 #$sec = $time * 86400;
43 my $sec = int( $time * 86400 + .5);
45 #$cdr->startdate( timelocal($3, $2, $1 ,$mday, $mon, $year) );
47 timelocal(0, 0, 0, $tmp_mday, $tmp_mon, $tmp_year) + $sec
52 # Dur. / Yes / Units = seconds
55 # OVS Type / Maybe / add "011" to international calls
60 sub { my($cdr, $ovs) = @_;
61 my $pre = ( $ovs =~ /^\s*[OZ]\s*$/i ) ? '011' : '1';
62 $cdr->dst( $pre. $cdr->dst ) unless $cdr->dst =~ /^$pre/;
71 # Prov/State / No / We will use your Freeside rating and description name
72 sub { my($cdr, $state) = @_;
73 $cdr->channel( $cdr->channel. ", $state" )
83 # Prov/State / No / We will use your Freeside rating and description name
84 sub { my($cdr, $state) = @_;
85 $cdr->dstchannel( $cdr->dstchannel. ", $state" )
90 # Would help to add "011" to international calls (if you are willing)
92 sub { my($cdr, $ovs) = @_;
93 my @ignore = ( 'BELL', 'CANADA', 'UNITED STATES', );
94 $cdr->dstchannel( $cdr->dstchannel. ", $ovs" )
95 if $ovs && ! grep { $ovs =~ /^\s*$_\s*$/ } @ignore;
98 # CC Ind. / No / Does show if Calling card but should not be required
102 # Call Charge / No / Bell billing info and is not required
105 # Account # / No / Bell billing info and is not required
108 # Net Charge / No / Bell billing info and is not required
111 # Surcharge / No / Taxes and is not required
114 # GST / No / Taxes and is not required
117 # PST / No / Taxes and is not required
120 # HST / No / Taxes and is not required