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' ) {
";state=" + state +
";zip=" + cf.elements['<% $taxpre %>zip'].value +
";country=" + country +
+ ";geocode=" + geocode +
";";
// popup a chooser
<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 %>">
% 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 %>
<%init>
my $conf = new FS::Conf;
-my $have_selected = 0;
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
$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;
}