diff options
author | ivan <ivan> | 2011-07-19 21:27:06 +0000 |
---|---|---|
committer | ivan <ivan> | 2011-07-19 21:27:06 +0000 |
commit | f05e5e44e3472e70f121f264ed39bd708673bcf7 (patch) | |
tree | b742a49629b8c40ec3aefe12e773d53d3a3a2608 /FS/FS/geocode_Mixin.pm | |
parent | ea6ab9c17d34e8e5b5149b9235dac600ab2ffd6d (diff) |
fix geocode guessing w/a 5 digit zip, RT#13595
Diffstat (limited to 'FS/FS/geocode_Mixin.pm')
-rw-r--r-- | FS/FS/geocode_Mixin.pm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/FS/FS/geocode_Mixin.pm b/FS/FS/geocode_Mixin.pm index 4f8d1e8..c1b9f86 100644 --- a/FS/FS/geocode_Mixin.pm +++ b/FS/FS/geocode_Mixin.pm @@ -155,7 +155,8 @@ sub geocode { $zip ||= ''; $plus4 ||= ''; #CCH specific location stuff - my $extra_sql = "AND plus4lo <= '$plus4' AND plus4hi >= '$plus4'"; + my $extra_sql = $plus4 ? "AND plus4lo <= '$plus4' AND plus4hi >= '$plus4'" + : ''; my @cust_tax_location = qsearch( { @@ -168,6 +169,11 @@ sub geocode { $geocode = $cust_tax_location[0]->geocode if scalar(@cust_tax_location); + warn "WARNING: customer ". $self->custnum. + ": multiple locations for zip ". $self->get("${prefix}zip"). + "; using arbitrary geocode $geocode\n" + if scalar(@cust_tax_location) > 1; + $geocode; } |