[freeside-commits] branch master updated. a73684bba1b297715a95eabb8845c5212523f4e1
Jeremy Davis
jeremyd at 420.am
Wed Aug 12 11:29:10 PDT 2015
The branch, master has been updated
via a73684bba1b297715a95eabb8845c5212523f4e1 (commit)
from a6b56c331ccd2fa42c74c5f01555ff407c14e3cf (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 a73684bba1b297715a95eabb8845c5212523f4e1
Author: Jeremy Davis <jeremyd at freeside.biz>
Date: Wed Aug 12 14:26:14 2015 -0400
#31495 Date changes for Earthlink
diff --git a/FS/FS/cdr/earthlink.pm b/FS/FS/cdr/earthlink.pm
index 5042f6f..c6c4e15 100644
--- a/FS/FS/cdr/earthlink.pm
+++ b/FS/FS/cdr/earthlink.pm
@@ -3,11 +3,13 @@ package FS::cdr::earthlink;
use strict;
use vars qw( @ISA %info $date);
use Time::Local;
-use FS::cdr qw(_cdr_date_parser_maker _cdr_min_parser_maker);
+use FS::cdr qw(_cdr_min_parser_maker);
use Date::Parse;
@ISA = qw(FS::cdr);
+my ($tmp_mday, $tmp_mon, $tmp_year);
+
%info = (
'name' => 'Earthlink',
'weight' => 120,
@@ -15,14 +17,30 @@ use Date::Parse;
'import_fields' => [
skip(3), #Account number/ SERVICE LOC / BILL NUMBER
- sub { my($cdr, $date) = @_;
- $date;
- }, #date
+ sub { my($cdr, $date) = @_;
+ $date =~ /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/
+ or die "unparseable date: $date";
+ ($tmp_mon, $tmp_mday, $tmp_year) = ($1, $2, $3);
+ }, #date
sub { my($cdr, $time) = @_;
+ $time =~ /^(\d{1,2}):(\d{1,2}):(\d{1,2}) (AM|PM)$/
+ or die "unparsable time: $time"; #maybe we shouldn't die...
+ my $hour = $1;
+ $hour += 12 if $4 eq 'PM' && $hour != 12;
+ $hour = 0 if $4 eq 'AM' && $hour == 12;
+
+ my $dt = DateTime->new(
+ year => $tmp_year,
+ month => $tmp_mon,
+ day => $tmp_mday,
+ hour => $hour,
+ minute => $2,
+ second => $3,
+ time_zone => 'local',
+ );
+ $cdr->set('startdate', $dt->epoch);
- my $datetime = $date. " ". $time;
- $cdr->set('startdate', $datetime );
- }, #time
+ },
skip(1), #TollFreeNumber
sub { my($cdr, $src) = @_;
$src =~ s/\D//g;
-----------------------------------------------------------------------
Summary of changes:
FS/FS/cdr/earthlink.pm | 32 +++++++++++++++++++++++++-------
1 file changed, 25 insertions(+), 7 deletions(-)
More information about the freeside-commits
mailing list