projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix date parsing when using international dates (package date edit), RT#8027
[freeside.git]
/
httemplate
/
misc
/
xmlhttp-cust_main-address_standardize.html
diff --git
a/httemplate/misc/xmlhttp-cust_main-address_standardize.html
b/httemplate/misc/xmlhttp-cust_main-address_standardize.html
index
e290301
..
3b9e142
100644
(file)
--- a/
httemplate/misc/xmlhttp-cust_main-address_standardize.html
+++ b/
httemplate/misc/xmlhttp-cust_main-address_standardize.html
@@
-1,7
+1,7
@@
-<%
to_j
son($return) %>
+<%
objToJ
son($return) %>
<%init>
<%init>
-my $DEBUG =
1
;
+my $DEBUG =
0
;
my $conf = new FS::Conf;
my $conf = new FS::Conf;
@@
-50,6
+50,9
@@
if ( $sub eq 'address_standardize' ) {
unless ( $verifier->is_error ) {
unless ( $verifier->is_error ) {
+ my $zip = $hash->{Zip5};
+ $zip .= '-'. $hash->{Zip4} if $hash->{Zip4} =~ /\d/;
+
$return = {
%$return,
"new_$pre".'company' => $hash->{FirmName},
$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".'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
};
my @fields = (qw( company address1 address2 city state zip )); #hmm
@@
-72,7
+75,9
@@
if ( $sub eq 'address_standardize' ) {
} else {
} else {
- warn "USPS WebTools error: ". $verifier->response. "\n";
+ $return->{$pre.'error'} = "USPS WebTools error: ".
+ $verifier->{error}{description};
+
}
}