[freeside-commits] branch FREESIDE_2_3_BRANCH updated. f86d0804182a0af81fdfa67bc49e79271b98457c
Ivan
ivan at 420.am
Fri Nov 2 13:49:41 PDT 2012
The branch, FREESIDE_2_3_BRANCH has been updated
via f86d0804182a0af81fdfa67bc49e79271b98457c (commit)
from 406a430c8ea79c7bee8038231449aca812d1067b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f86d0804182a0af81fdfa67bc49e79271b98457c
Author: Ivan Kohler <ivan at freeside.biz>
Date: Fri Nov 2 13:49:40 2012 -0700
fix new troop dates, RT#20081
diff --git a/FS/FS/cdr/troop2.pm b/FS/FS/cdr/troop2.pm
index ee64740..17a8b2a 100644
--- a/FS/FS/cdr/troop2.pm
+++ b/FS/FS/cdr/troop2.pm
@@ -2,11 +2,12 @@ package FS::cdr::troop2;
use strict;
use base qw( FS::cdr );
-use vars qw( %info $tmp_date $tmp_src_city $tmp_dst_city );
-use Date::Parse;
-#use Time::Local;
+use vars qw( %info $tmp_mon $tmp_mday $tmp_year $tmp_src_city $tmp_dst_city );
+use Time::Local;
##use FS::cdr qw( _cdr_date_parser_maker _cdr_min_parser_maker );
+use Data::Dumper;
+
%info = (
'name' => 'Troop',
'weight' => 219,
@@ -17,16 +18,27 @@ use Date::Parse;
'userfield', #account_num (userfield?)
+ # XXX false laziness w/bell_west.pm
#call_date
sub { my($cdr, $date) = @_;
- #is this an excel date? or just text?
- $tmp_date = $date;
+
+ my $datetime = DateTime::Format::Excel->parse_datetime( $date );
+ $tmp_mon = $datetime->mon_0;
+ $tmp_mday = $datetime->mday;
+ $tmp_year = $datetime->year;
},
#call_time
sub { my($cdr, $time) = @_;
- #is this an excel time? or just text?
- $cdr->startdate( str2time("$tmp_date $time") );
+ #my($sec, $min, $hour, $mday, $mon, $year)= localtime($cdr->startdate);
+
+ #$sec = $time * 86400;
+ my $sec = int( $time * 86400 + .5);
+
+ #$cdr->startdate( timelocal($3, $2, $1 ,$mday, $mon, $year) );
+ $cdr->startdate(
+ timelocal(0, 0, 0, $tmp_mday, $tmp_mon, $tmp_year) + $sec
+ );
},
'src', #orig_tn
-----------------------------------------------------------------------
Summary of changes:
FS/FS/cdr/troop2.pm | 26 +++++++++++++++++++-------
1 files changed, 19 insertions(+), 7 deletions(-)
More information about the freeside-commits
mailing list