X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fstandardize_locations.js;h=ff7183b26a22823eabe1d468a89f057cb35085af;hb=475ae93877f1d834941f7b9adcc35ee84c5c22fa;hp=2d1fc742334c52812198ba3992b6d3e2fb30456a;hpb=777a6997a004dc4ea99bccabe494f77f114db1a3;p=freeside.git diff --git a/httemplate/elements/standardize_locations.js b/httemplate/elements/standardize_locations.js index 2d1fc7423..ff7183b26 100644 --- a/httemplate/elements/standardize_locations.js +++ b/httemplate/elements/standardize_locations.js @@ -179,7 +179,7 @@ function confirm_manual_address() { function post_standardization() { -% if ( $conf->exists('enable_taxproducts') ) { +% if ( $need_tax_location ) { var cf = document.<% $formname %>; @@ -204,9 +204,8 @@ function post_standardization() { var state_el = cf.elements[prefix + 'state']; var state = state_el.options[ state_el.selectedIndex ].value; - var url = "<% $p %>/misc/choose_tax_location.html" + - "?data_vendor=cch-zip" + - ";city=" + cf.elements[prefix + 'city'].value + + var url = "<% $p %>/misc/choose_tax_location.html?" + + "city=" + cf.elements[prefix + 'city'].value + ";state=" + state + ";zip=" + cf.elements[prefix + 'zip'].value + ";country=" + country + @@ -252,11 +251,9 @@ function update_geocode() { prefix = 'bill_'; } - //alert(what.options[what.selectedIndex].value); - var argsHash = eval('(' + what.options[what.selectedIndex].value + ')'); - cf.elements[prefix + 'city'].value = argsHash['city']; - setselect(cf.elements[prefix + 'state'], argsHash['state']); - cf.elements[prefix + 'zip'].value = argsHash['zip']; +%# this used to set the city/state/zip to the selected value; I think +%# that's wrong. + var argsHash = JSON.parse(what.value); cf.elements[prefix + 'geocode'].value = argsHash['geocode']; <% $post_geocode %>; @@ -282,10 +279,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; @@ -293,10 +287,15 @@ function confirm_censustract() { '<%$p%>/misc/confirm-censustract.html', 'q=' + encodeURIComponent(JSON.stringify(address_info)), function() { - overlib( OLresponseAJAX, CAPTION, 'Confirm censustract', STICKY, - AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, - 576, HEIGHT, 268, BGCOLOR, '#333399', CGCOLOR, '#333399', - TEXTSIZE, 3 ); + if ( OLresponseAJAX ) { + overlib( OLresponseAJAX, CAPTION, 'Confirm censustract', STICKY, + AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, + 576, HEIGHT, 268, BGCOLOR, '#333399', CGCOLOR, '#333399', + TEXTSIZE, 3 ); + } else { + // no response + <% $post_censustract %>; + } }, 0); } else { @@ -343,4 +342,7 @@ if ( $census_functions ) { $post_geocode = 'confirm_censustract()'; } +my $tax_engine = FS::TaxEngine->new; +my $need_tax_location = $tax_engine->info->{manual_tax_location} ? 1 : 0; +