X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fgeocode_Mixin.pm;h=c1b9f865b7cde9f3b4d31c145cf8a5c519c4dd26;hb=72deba42ac5847c2a6bdeea20157035b8f9df7ae;hp=4f8d1e85c94a7b4f2a98cf71e6705bd0955269a4;hpb=b5c4237a34aef94976bc343c8d9e138664fc3984;p=freeside.git diff --git a/FS/FS/geocode_Mixin.pm b/FS/FS/geocode_Mixin.pm index 4f8d1e85c..c1b9f865b 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; }