From: Mark Wells Date: Tue, 2 Dec 2014 23:43:20 +0000 (-0800) Subject: when address standardization returns a censustract, don't try to look it up through... X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=b79d815338e1895fce025aef5dcb5f9f42028562 when address standardization returns a censustract, don't try to look it up through FFIEC also, #32459 --- diff --git a/httemplate/edit/cust_main/bottomfixup.js b/httemplate/edit/cust_main/bottomfixup.js index 8aef1e72c..6a9deb92a 100644 --- a/httemplate/edit/cust_main/bottomfixup.js +++ b/httemplate/edit/cust_main/bottomfixup.js @@ -100,14 +100,13 @@ function copyelement(from, to) { //alert(from + " (" + from.type + "): " + to.name + " => " + to.value); } -% # the value in pre+'censustract' is the confirmed censustract; if it's set, -% # and the user hasn't changed it manually, skip this +% # the value in pre+'censustract' is the confirmed censustract (either from +% # the previous saved record, or from address standardization (if the backend +% # supports it), or from an aborted previous submit. only need to reconfirm +% # if it's empty. function confirm_censustract(pre) { var cf = document.CustomerForm; - if ( cf.elements[pre+'censustract'].value == '' || - cf.elements[pre+'enter_censustract'].value != - cf.elements[pre+'censustract'].value ) - { + if ( cf.elements[pre+'censustract'].value == '' ) { var address_info = form_address_info(); address_info[pre+'latitude'] = cf.elements[pre+'latitude'].value; address_info[pre+'longitude'] = cf.elements[pre+'longitude'].value; diff --git a/httemplate/elements/location.html b/httemplate/elements/location.html index 5cdc424a7..214a7d5f2 100644 --- a/httemplate/elements/location.html +++ b/httemplate/elements/location.html @@ -59,12 +59,7 @@ Example: % } else { - - + <& hidden.html, field => $pre.'locationname', value => $object->get('locationname') &> % } @@ -102,10 +97,7 @@ Example: % } else { # alternate format - +<& hidden.html, field => $pre.'address2', value => $object->get('address2') &> <<%$th%> ALIGN="right">Unit type and #> @@ -227,14 +219,14 @@ Example: % } else { % foreach (qw(latitude longitude)) { - +<& hidden.html, field => $pre.$_, value => $object->get($_) &> % } % } - - - - - +% +% foreach (qw(coord_auto geocode censustract censusyear)) { + <& hidden.html, field => $pre.$_, value => $object->get($_) &> +% } +% % if ( $opt{enable_censustract} ) { Census tract @@ -259,7 +251,7 @@ Example: % } else { - + <& hidden.html, field => $pre.'district', value => $object->get('district') &> % } %# For address standardization: @@ -267,11 +259,11 @@ Example: %# to re-standardize % foreach (qw(address1 city state country zip latitude % longitude censustract district addr_clean) ) { - +<& hidden.html, field => 'old_'.$pre.$_, value => $object->get($_) &> % } %# Placeholders - - +<& hidden.html, field => $pre.'cachenum', value => '' &> +<& hidden.html, field => $pre.'addr_clean', value => '' &> diff --git a/httemplate/elements/standardize_locations.js b/httemplate/elements/standardize_locations.js index 307f822c9..f114e341c 100644 --- a/httemplate/elements/standardize_locations.js +++ b/httemplate/elements/standardize_locations.js @@ -282,10 +282,7 @@ function setselect(el, value) { function confirm_censustract() { % if ( FS::Conf->new->exists('cust_main-require_censustract') ) { var form = document.<% $formname %>; - // this is the existing/confirmed censustract, not the manually entered one - if ( form.elements['censustract'].value == '' || - form.elements['censustract'].value != - form.elements['enter_censustract'].value ) { + if ( form.elements['censustract'].value == '' ) { var address_info = form_address_info(); address_info['latitude'] = form.elements['latitude'].value; address_info['longitude'] = form.elements['longitude'].value; diff --git a/httemplate/misc/xmlhttp-address_standardize.html b/httemplate/misc/xmlhttp-address_standardize.html index 618265364..d0255a02a 100644 --- a/httemplate/misc/xmlhttp-address_standardize.html +++ b/httemplate/misc/xmlhttp-address_standardize.html @@ -43,6 +43,10 @@ foreach my $pre ( @prefixes ) { 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'}; }