X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fxmlhttp-address_standardize.html;h=d0255a02a7b484e35ce235732c8f47a9970db166;hb=6cca67f8c829f96a51684060f432b105c831af0a;hp=9880571632c752ff06719247c0728cf25dcab20e;hpb=5ad226c0ff7759184ea26d66292ccebd2ec00af7;p=freeside.git diff --git a/httemplate/misc/xmlhttp-address_standardize.html b/httemplate/misc/xmlhttp-address_standardize.html index 988057163..d0255a02a 100644 --- a/httemplate/misc/xmlhttp-address_standardize.html +++ b/httemplate/misc/xmlhttp-address_standardize.html @@ -1,4 +1,4 @@ -<% encode_json($return) %> +<% encode_json($return) %>\ <%init> local $SIG{__DIE__}; #disable Mason error trap @@ -16,12 +16,10 @@ my %old = %{ decode_json($cgi->param('arg')) } my %new; -my @prefixes; -if ($old{onlyship}) { - @prefixes = ('ship_'); -} elsif ( $old{same} ) { +my @prefixes = (''); +if ( $old{same} ) { @prefixes = ('bill_'); -} else { +} elsif ( $old{billship} ) { @prefixes = ('bill_', 'ship_'); } my $all_same = 1; @@ -44,6 +42,12 @@ foreach my $pre ( @prefixes ) { $all_same = 0 if ( $new{$pre.$_} ne $old{$pre.$_} ); last if !$all_same; } + + $all_same = 0 if ( length( $old{$pre.'censustract'} ) > 0 && + length( $new{$pre.'censustract'} ) > 0 && + $old{$pre.'censustract'} ne $new{$pre.'censustract'} ); + + $all_same = 0 if $new{$pre.'error'}; } my $return = { old => \%old, new => \%new, all_same => $all_same };