summaryrefslogtreecommitdiff
path: root/httemplate/edit/cust_main/bottomfixup.js
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2012-09-29 16:36:46 -0700
committerMark Wells <mark@freeside.biz>2012-09-29 16:36:46 -0700
commit33beebf4cb42eba3e1dd868ad5e0af102de961da (patch)
tree860712543dcc74ff2402a4ed8d73e8cd553e62d4 /httemplate/edit/cust_main/bottomfixup.js
parent7ac86daf67b0a95153b736d5811f9050363f6553 (diff)
update address standardization for cust_location changes
Diffstat (limited to 'httemplate/edit/cust_main/bottomfixup.js')
-rw-r--r--httemplate/edit/cust_main/bottomfixup.js17
1 files changed, 11 insertions, 6 deletions
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();
}