summaryrefslogtreecommitdiff
path: root/FS/FS
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2015-04-08 15:57:00 -0500
committerJonathan Prykop <jonathan@freeside.biz>2015-04-08 15:57:00 -0500
commit024ebf9e47096a92f7eaff8687231f5f81285330 (patch)
tree0926ae5bdac10dced9b22f9f595b1ecd4e23aeae /FS/FS
parent328e2e3bc40c6aef5a8bc5984f837cac2d8e95af (diff)
parentc464d2c65c63ab05f306dad9d718e1eb49e42851 (diff)
Merge branch 'FREESIDE_3_BRANCH' of git.freeside.biz:/home/git/freeside into FREESIDE_3_BRANCH
Diffstat (limited to 'FS/FS')
-rw-r--r--FS/FS/Mason.pm2
-rw-r--r--FS/FS/Misc/Geo.pm6
-rw-r--r--FS/FS/cdr/enswitch.pm8
-rw-r--r--FS/FS/cdr/ispphone.pm28
4 files changed, 18 insertions, 26 deletions
diff --git a/FS/FS/Mason.pm b/FS/FS/Mason.pm
index 4cf079837..d0a530e9a 100644
--- a/FS/FS/Mason.pm
+++ b/FS/FS/Mason.pm
@@ -131,7 +131,7 @@ if ( -e $addl_handler_use_file ) {
use FS::UID qw( getotaker dbh datasrc driver_name );
use FS::Record qw( qsearch qsearchs fields dbdef
str2time_sql str2time_sql_closing
- midnight_sql
+ midnight_sql regexp_sql
);
use FS::Conf;
use FS::CGI qw(header menubar table itable ntable idiot
diff --git a/FS/FS/Misc/Geo.pm b/FS/FS/Misc/Geo.pm
index 7ab6d280d..168e4e959 100644
--- a/FS/FS/Misc/Geo.pm
+++ b/FS/FS/Misc/Geo.pm
@@ -334,8 +334,12 @@ sub standardize_uscensus {
censustract => $result->censustract,
};
} else {
- die "can't parse address '".$result->address."'";
+ die "Geocoding returned '".$result->address."', which does not seem to be a valid address.\n";
}
+ } elsif ( $result->match_level eq 'Tie' ) {
+ die "Geocoding was not able to identify a unique matching address.\n";
+ } elsif ( $result->match_level ) {
+ die "Geocoding did not find a matching address.\n";
} else {
warn Dumper($result) if $DEBUG;
die $result->error_message;
diff --git a/FS/FS/cdr/enswitch.pm b/FS/FS/cdr/enswitch.pm
index c1966b404..26d27821e 100644
--- a/FS/FS/cdr/enswitch.pm
+++ b/FS/FS/cdr/enswitch.pm
@@ -16,10 +16,10 @@ use FS::cdr_type;
'startdate', #Start, already a unix timestamp
skip(2), #Start date, Start time
'enddate', #End
- skip(6), #End date, End time
+ skip(4), #End date, End time
#Calling customer, Calling type
'src', #Calling number
- skip(1), #Called type
+ 'dcontext', #Called type
'dst', #Called number
skip(26), #Destination customer, Destination type
#Destination number
@@ -38,8 +38,8 @@ use FS::cdr_type;
'duration', #Total seconds
skip(1), #Ring seconds
'billsec', #Billable seconds
- 'upstream_price', #Cost
- skip(1), #Cost including taxes
+ skip(2), #Cost
+ #Cost including taxes
'accountcode', #Billing customer
skip(3), #Billing customer name, Billing type, Billing reference
],
diff --git a/FS/FS/cdr/ispphone.pm b/FS/FS/cdr/ispphone.pm
index 49d1b07f4..2817d53c1 100644
--- a/FS/FS/cdr/ispphone.pm
+++ b/FS/FS/cdr/ispphone.pm
@@ -3,7 +3,7 @@ package FS::cdr::ispphone;
use strict;
use vars qw( @ISA %info $tmp_mon $tmp_mday $tmp_year );
use Time::Local;
-use FS::cdr;
+use FS::cdr qw ( _cdr_date_parser_maker );
use Date::Parse;
@ISA = qw(FS::cdr);
@@ -11,29 +11,15 @@ use Date::Parse;
%info = (
'name' => 'ISPPhone',
'weight' => 123,
- 'header' => 2,
+ 'header' => 1,
'import_fields' => [
+ 'accountcode', # Accountcode
'src', # Form
'dst', # To
- 'upstream_dst_regionname', # Country
- 'dcontext', # Description
-
- sub { my ($cdr, $calldate) = @_;
- $cdr->set('calldate', $calldate);
-
- my $tmp_date;
-
- if ($calldate =~ /^(\d{2})\/(\d{2})\/(\d{2})\s*(\d{1,2}):(\d{2})$/){
-
- $tmp_date = "$2/$1/$3 $4:$5:$6";
-
- } else { $tmp_date = $calldate; }
-
- $tmp_date = str2time($tmp_date);
- $cdr->set('startdate', $tmp_date);
-
- }, #DateTime
+ skip(1), # Country
+ 'upstream_dst_regionname', # Description
+_cdr_date_parser_maker('startdate'), #DateTime
sub { my ($cdr, $duration) = @_;
my ($min,$sec) = split(/:/, $duration);
@@ -47,5 +33,7 @@ use Date::Parse;
);
+sub skip { map {''} (1..$_[0]) }
+
1;