[freeside-commits] branch master updated. 59ca3e541bcc1ffe75d0ad70c410f30e35bcf90b

Mark Wells mark at 420.am
Thu Jun 20 15:40:58 PDT 2013


The branch, master has been updated
       via  59ca3e541bcc1ffe75d0ad70c410f30e35bcf90b (commit)
      from  a6dd5bc6ba6c655b1707a016db4e97e269b718e5 (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 59ca3e541bcc1ffe75d0ad70c410f30e35bcf90b
Author: Mark Wells <mark at freeside.biz>
Date:   Thu Jun 20 15:40:51 2013 -0700

    ezlocate: accept non-postal standardized address as a fallback, #23679

diff --git a/FS/FS/Misc/Geo.pm b/FS/FS/Misc/Geo.pm
index 53efb36..a93d98f 100644
--- 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$/;
 
-  {
-    address1    => $match->{STD_ADDR},
+  my %result = (
+    address1    => $match->{MAT_ADDR},
     address2    => $location->{address2},
-    city        => $match->{STD_CITY},
-    state       => $match->{STD_ST},
+    city        => $match->{MAT_CITY},
+    state       => $match->{MAT_ST},
     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',
-  };
+  );
+  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

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/Misc/Geo.pm |   24 ++++++++++++++++++------
 1 files changed, 18 insertions(+), 6 deletions(-)




More information about the freeside-commits mailing list