summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjeff <jeff>2009-10-05 14:04:10 +0000
committerjeff <jeff>2009-10-05 14:04:10 +0000
commitcf86f3223d1e30853f52c0f5a7a6331f27aed9cb (patch)
treefc3afb99e0eb2f0effebc0a403a63cdcabae5952
parent8941cdf14a441e17e2c61e41beb3e7bdbaa0988e (diff)
low hanging fruit: improvement in tax location selection RT#6000
-rw-r--r--httemplate/edit/cust_main/bottomfixup.js2
-rw-r--r--httemplate/edit/cust_main/choose_tax_location.html6
-rw-r--r--httemplate/edit/cust_main/contact.html2
3 files changed, 8 insertions, 2 deletions
diff --git a/httemplate/edit/cust_main/bottomfixup.js b/httemplate/edit/cust_main/bottomfixup.js
index d6d4f920f..1a06d9497 100644
--- a/httemplate/edit/cust_main/bottomfixup.js
+++ b/httemplate/edit/cust_main/bottomfixup.js
@@ -197,6 +197,7 @@ function post_standardization() {
var country_el = cf.elements['<% $taxpre %>country'];
var country = country_el.options[ country_el.selectedIndex ].value;
+ var geocode = cf.elements['geocode'].value;
if ( country == 'CA' || country == 'US' ) {
@@ -209,6 +210,7 @@ function post_standardization() {
";state=" + state +
";zip=" + cf.elements['<% $taxpre %>zip'].value +
";country=" + country +
+ ";geocode=" + geocode +
";";
// popup a chooser
diff --git a/httemplate/edit/cust_main/choose_tax_location.html b/httemplate/edit/cust_main/choose_tax_location.html
index be93a5de8..ac475c54b 100644
--- a/httemplate/edit/cust_main/choose_tax_location.html
+++ b/httemplate/edit/cust_main/choose_tax_location.html
@@ -1,5 +1,6 @@
<FORM NAME="choosegeocodeform">
<CENTER><BR><B>Choose tax location</B><BR><BR>
+<P>the geocode is:<% $header %></P>
<P STYLE="<% $style %>"><% $header %></P>
<SELECT NAME='geocodes' ID='geocodes' STYLE="<% $style %>">
@@ -18,7 +19,7 @@
% foreach qw( city county state );
% $content .= $location->cityflag eq 'I' ? 'Y' : 'N' ;
% my $selected = '' ;
-% if (!$have_selected && lc($location->city) eq lc($location{city})) {
+% if ($geocode && $location->geocode eq $geocode) {
% $selected = 'SELECTED';
% }
<OPTION VALUE="<% $value %>" STYLE="<% $style %>" <% $selected %>><% $content %>
@@ -36,7 +37,6 @@
<%init>
my $conf = new FS::Conf;
-my $have_selected = 0;
my %location = ();
@@ -46,6 +46,8 @@ my %location = ();
($location{zip}) = $cgi->param('zip') =~ /^([-\w ]+)$/;
($location{country}) = $cgi->param('country') =~ /^([\w ]+)$/;
+my($geocode) = $cgi->param('geocode') =~ /^([\w]+)$/;
+
my($zip5, $zip4) = split('-', $location{zip});
#only support US & CA
diff --git a/httemplate/edit/cust_main/contact.html b/httemplate/edit/cust_main/contact.html
index 3bed54b85..3ccee62e5 100644
--- a/httemplate/edit/cust_main/contact.html
+++ b/httemplate/edit/cust_main/contact.html
@@ -111,6 +111,8 @@ $cust_main->set($pre.'state', $statedefault )
$cust_main->set('stateid_state', $cust_main->state )
unless $pre || $cust_main->get('stateid_state');
+$opt{geocode} ||= $cust_main->get('geocode');
+
if ( $conf->exists('cust_main-require_censustract') ) {
$opt{censustract} ||= $cust_main->censustract;
}