X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fxmlhttp-cust_main-address_standardize.html;h=3b9e142f55f495a6e5df3356e0f91424be63f49a;hb=ea3c94b9862524f0d17931e77bf3955bac5ad83f;hp=8532bb23a4b47c5a1f0c4432e6da670e1beee5cd;hpb=41d9ccc9b265168f2a6fdcf3533c6384b7d6dd58;p=freeside.git diff --git a/httemplate/misc/xmlhttp-cust_main-address_standardize.html b/httemplate/misc/xmlhttp-cust_main-address_standardize.html index 8532bb23a..3b9e142f5 100644 --- a/httemplate/misc/xmlhttp-cust_main-address_standardize.html +++ b/httemplate/misc/xmlhttp-cust_main-address_standardize.html @@ -50,6 +50,9 @@ if ( $sub eq 'address_standardize' ) { unless ( $verifier->is_error ) { + my $zip = $hash->{Zip5}; + $zip .= '-'. $hash->{Zip4} if $hash->{Zip4} =~ /\d/; + $return = { %$return, "new_$pre".'company' => $hash->{FirmName}, @@ -57,7 +60,7 @@ if ( $sub eq 'address_standardize' ) { "new_$pre".'address2' => $hash->{Address1}, "new_$pre".'city' => $hash->{City}, "new_$pre".'state' => $hash->{State}, - "new_$pre".'zip' => $hash->{Zip5}. '-'. $hash->{Zip4}, + "new_$pre".'zip' => $zip, }; my @fields = (qw( company address1 address2 city state zip )); #hmm @@ -72,7 +75,9 @@ if ( $sub eq 'address_standardize' ) { } else { - warn "USPS WebTools error: ". $verifier->response. "\n"; + $return->{$pre.'error'} = "USPS WebTools error: ". + $verifier->{error}{description}; + }