X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main%2Fbottomfixup.js;fp=httemplate%2Fedit%2Fcust_main%2Fbottomfixup.js;h=b64f6bdb23eb9b7fc1c01d45fe7bae56a0cd37aa;hb=33beebf4cb42eba3e1dd868ad5e0af102de961da;hp=4e11087273fb68455cbc0dc6e0034fffd27b0ab2;hpb=7ac86daf67b0a95153b736d5811f9050363f6553;p=freeside.git diff --git a/httemplate/edit/cust_main/bottomfixup.js b/httemplate/edit/cust_main/bottomfixup.js index 4e1108727..b64f6bdb2 100644 --- a/httemplate/edit/cust_main/bottomfixup.js +++ b/httemplate/edit/cust_main/bottomfixup.js @@ -68,7 +68,9 @@ function copy_payby_fields() { } <% include( '/elements/standardize_locations.js', - 'callback' => 'submit_continue();' + 'callback' => 'submit_continue();', + 'main_prefix' => 'bill_', + 'no_company' => 1, ) %> @@ -94,14 +96,17 @@ function copyelement(from, to) { //alert(from + " (" + from.type + "): " + to.name + " => " + to.value); } +var prefix; + % # the value in 'censustract' is the confirmed censustract; if it's set, % # do nothing here function confirm_censustract() { + prefix = document.getElementById('same').checked ? 'bill_' : 'ship_'; var cf = document.CustomerForm; - if ( cf.elements['censustract'].value == '' ) { + if ( cf.elements[prefix+'censustract'].value == '' ) { var address_info = form_address_info(); - address_info['ship_latitude'] = cf.elements['ship_latitude'].value; - address_info['ship_longitude'] = cf.elements['ship_longitude'].value; + address_info[prefix+'latitude'] = cf.elements[prefix+'latitude'].value; + address_info[prefix+'longitude'] = cf.elements[prefix+'longitude'].value; OLpostAJAX( '<%$p%>/misc/confirm-censustract.html', 'q=' + encodeURIComponent(JSON.stringify(address_info)), @@ -118,8 +123,8 @@ function confirm_censustract() { %# called from confirm-censustract.html function set_censustract(tract, year) { var cf = document.CustomerForm; - cf.elements['censustract'].value = tract; - cf.elements['censusyear'].value = year; + cf.elements[prefix+'censustract'].value = tract; + cf.elements[prefix+'censusyear'].value = year; submit_continue(); }