RT# 80488 Live look up of WA state tax district
[freeside.git] / httemplate / elements / tr-select-cust_location.html
index 36ee7b6..1e6cf5b 100644 (file)
@@ -202,13 +202,23 @@ Example:
      'alt_format'         => $opt{'alt_format'},
      'enable_coords'      => 1,
      'enable_censustract' => 1,
+     'enable_district'    => $conf->exists('tax_district_method') ? 1 : 0,
 &>
 
-% unless ( $prospect_main ) {
-  <SCRIPT TYPE="text/javascript">
+<SCRIPT TYPE="text/javascript">
+% if ( $prospect_main ) { # && ! $opt{is_optional} ) {
+
+    changeSelect(document.getElementById('country'), <% $cust_location->country || $countrydefault |js_string %>);
+
+    country_changed( document.getElementById('country'),
+                     fix_state_factory( <% $cust_location->state || $statedefault |js_string %>,
+                                        ''
+                                      )
+                   );
+% } elsif ( $locationnum != -1 ) {
     locationnum_changed(document.getElementById('locationnum'));
-  </SCRIPT>
 % }
+</SCRIPT>
 
 <%init>