projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b5c544b
)
ezlocate: accept non-postal standardized address as a fallback, #23679
author
Mark Wells
<mark@freeside.biz>
Thu, 20 Jun 2013 22:40:12 +0000
(15:40 -0700)
committer
Mark Wells
<mark@freeside.biz>
Thu, 20 Jun 2013 22:40:12 +0000
(15:40 -0700)
FS/FS/Misc/Geo.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Misc/Geo.pm
b/FS/FS/Misc/Geo.pm
index
53efb36
..
a93d98f
100644
(file)
--- a/
FS/FS/Misc/Geo.pm
+++ b/
FS/FS/Misc/Geo.pm
@@
-383,19
+383,31
@@
sub standardize_ezlocate {
die $ezlocate_error{$match->{MAT_STAT}}."\n"
unless $match->{MAT_STAT} =~ /^B\d$/;
die $ezlocate_error{$match->{MAT_STAT}}."\n"
unless $match->{MAT_STAT} =~ /^B\d$/;
- {
- address1 => $match->{
STD
_ADDR},
+ my %result = (
+ address1 => $match->{
MAT
_ADDR},
address2 => $location->{address2},
address2 => $location->{address2},
- city => $match->{
STD
_CITY},
- state => $match->{
STD
_ST},
+ city => $match->{
MAT
_CITY},
+ state => $match->{
MAT
_ST},
country => $location->{country},
country => $location->{country},
- zip => $match->{
STD_ZIP}.'-'.$match->{STD_P4
},
+ zip => $match->{
MAT_ZIP
},
latitude => $match->{MAT_LAT},
longitude => $match->{MAT_LON},
censustract => $match->{FIPS_ST}.$match->{FIPS_CTY}.
sprintf('%07.2f',$match->{CEN_TRCT}),
addr_clean => 'Y',
latitude => $match->{MAT_LAT},
longitude => $match->{MAT_LON},
censustract => $match->{FIPS_ST}.$match->{FIPS_CTY}.
sprintf('%07.2f',$match->{CEN_TRCT}),
addr_clean => 'Y',
- };
+ );
+ if ( $match->{STD_ADDR} ) {
+ # then they have a postal standardized address for us
+ %result = ( %result,
+ address1 => $match->{STD_ADDR},
+ address2 => $location->{address2},
+ city => $match->{STD_CITY},
+ state => $match->{STD_ST},
+ zip => $match->{STD_ZIP}.'-'.$match->{STD_P4},
+ );
+ }
+
+ \%result;
}
=back
}
=back