[freeside-commits] branch master updated. 84fa358b56b89205fff99927080d5c28c01d57ff

Mark Wells mark at 420.am
Sat Nov 10 13:16:09 PST 2012


The branch, master has been updated
       via  84fa358b56b89205fff99927080d5c28c01d57ff (commit)
      from  a5318b8239e3a35cbbeb5510b451f5ba5f622846 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 84fa358b56b89205fff99927080d5c28c01d57ff
Author: Mark Wells <mark at freeside.biz>
Date:   Fri Nov 9 17:03:41 2012 -0800

    various customer location-related fixes, #13763

diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi
index 0aded59..be00213 100755
--- a/httemplate/edit/cust_main.cgi
+++ b/httemplate/edit/cust_main.cgi
@@ -316,8 +316,6 @@ if ( $cgi->param('error') ) {
   $payinfo = '';
 
   $cgi->param('tagnum', FS::part_tag->default_tags);
-  $cust_main->coord_auto('Y');
-  $cust_main->ship_coord_auto('Y');
 
   if ( $cgi->param('qualnum') =~ /^(\d+)$/ ) {
     my $qualnum = $1;
@@ -357,14 +355,18 @@ if ( $cgi->param('error') ) {
     my $countrydefault = $conf->config('countrydefault') || 'US';
     my $statedefault = $conf->config('statedefault') || 'CA';
     $cust_main->set('bill_location', 
-      FS::cust_location->new(
-        { country => $countrydefault, state => $statedefault }
-      )
+      FS::cust_location->new( {
+          country => $countrydefault,
+          state => $statedefault,
+          coord_auto => 'Y',
+      } )
     );
     $cust_main->set('ship_location',
-      FS::cust_location->new(
-        { country => $countrydefault, state => $statedefault }
-      )
+      FS::cust_location->new( {
+          country => $countrydefault,
+          state => $statedefault,
+          coord_auto => 'Y',
+      } )
     );
   }
 
diff --git a/httemplate/edit/cust_main/bottomfixup.js b/httemplate/edit/cust_main/bottomfixup.js
index 4f3b7da..6fc7989 100644
--- a/httemplate/edit/cust_main/bottomfixup.js
+++ b/httemplate/edit/cust_main/bottomfixup.js
@@ -96,11 +96,11 @@ function copyelement(from, to) {
   //alert(from + " (" + from.type + "): " + to.name + " => " + to.value);
 }
 
-% # the value in 'censustract' is the confirmed censustract; if it's set,
+% # the value in 'ship_censustract' is the confirmed censustract; if it's set,
 % # do nothing here
 function confirm_censustract() {
   var cf = document.CustomerForm;
-  if ( cf.elements['censustract'].value == '' ) {
+  if ( cf.elements['ship_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;
@@ -120,8 +120,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['ship_censustract'].value = tract;
+  cf.elements['ship_censusyear'].value = year;
   submit_continue();
 }
 
diff --git a/httemplate/elements/standardize_locations.js b/httemplate/elements/standardize_locations.js
index f6564a5..ff45b18 100644
--- a/httemplate/elements/standardize_locations.js
+++ b/httemplate/elements/standardize_locations.js
@@ -25,6 +25,9 @@ function form_address_info() {
     'ship_state':    ship_state_el.options[ ship_state_el.selectedIndex ].value,
     'ship_zip':      cf.elements['<% $ship_prefix %>zip'].value,
     'ship_country':  cf.elements['<% $ship_prefix %>country'].value,
+% if ( !$onlyship ) {
+    'same':     cf.elements['same'].checked
+% }
   };
 }
 
@@ -86,9 +89,9 @@ function standardize_locations() {
     address_standardize(JSON.stringify(address_info), confirm_standardize);
   }
   else {
-    cf.elements['ship_addr_clean'].value = 'Y';
+    cf.elements['<% $ship_prefix %>addr_clean'].value = 'Y';
 %   if ( !$onlyship ) {
-    cf.elements['addr_clean'].value = 'Y';
+    cf.elements['<% $main_prefix %>addr_clean'].value = 'Y';
 %   }
     post_standardization();
   }
@@ -194,7 +197,7 @@ function confirm_manual_address() {
 % if ( $withcensus ) {
   var cf = document.<% $formname %>;
   cf.elements['<% $main_prefix %>censustract'].value =
-  cf.elements['<% $main_prefix %>enter_censustract'].value;
+  cf.elements['enter_censustract'].value;
 % }
   post_standardization();
 }
diff --git a/httemplate/misc/confirm-address_standardize.html b/httemplate/misc/confirm-address_standardize.html
index 3603b95..a6f4b06 100644
--- a/httemplate/misc/confirm-address_standardize.html
+++ b/httemplate/misc/confirm-address_standardize.html
@@ -11,8 +11,15 @@ Confirm address standardization
 
 </B><BR><BR>
 <TABLE WIDTH="100%">
+% my @prefixes;
+% if ( $old{onlyship} ) {
+%   @prefixes = ('ship_');
+% } elsif ( $old{same} ) {
+%   @prefixes = ('');
+% } else {
+%   @prefixes = ('', 'ship_');
+% }
 % for my $pre ('', 'ship_') {
-%   next if !$pre and $old{onlyship};
 %   my $name = $pre eq 'ship_' ? 'service' : 'billing';
 %   if ( $new{$pre.'addr_clean'} ) {
   <TR>
diff --git a/httemplate/misc/xmlhttp-address_standardize.html b/httemplate/misc/xmlhttp-address_standardize.html
index f53c35f..e28c06f 100644
--- a/httemplate/misc/xmlhttp-address_standardize.html
+++ b/httemplate/misc/xmlhttp-address_standardize.html
@@ -16,8 +16,15 @@ my %old = %{ decode_json($cgi->param('arg')) }
 
 my %new;
 
-foreach my $pre ( '', 'ship_' ) {
-  next unless ($pre || !$old{onlyship});
+my @prefixes;
+if ($old{onlyship}) {
+  @prefixes = ('ship_');
+} elsif ( $old{same} ) {
+  @prefixes = ('');
+} else {
+  @prefixes = ('', 'ship_');
+}
+foreach my $pre ( @prefixes ) {
 
   my $location = {
     map { $_ => $old{$pre.$_} }

-----------------------------------------------------------------------

Summary of changes:
 httemplate/edit/cust_main.cgi                    |   18 ++++++++++--------
 httemplate/edit/cust_main/bottomfixup.js         |    8 ++++----
 httemplate/elements/standardize_locations.js     |    9 ++++++---
 httemplate/misc/confirm-address_standardize.html |    9 ++++++++-
 httemplate/misc/xmlhttp-address_standardize.html |   11 +++++++++--
 5 files changed, 37 insertions(+), 18 deletions(-)




More information about the freeside-commits mailing list