summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorMitch Jackson <mitch@freeside.biz>2019-01-19 07:41:08 -0500
committerMitch Jackson <mitch@freeside.biz>2019-01-20 16:44:06 -0500
commit9f179ee5fc7fc07a3f5e03ad1ad58cd3cadf1a56 (patch)
treebb33cdd7fa5a6d1d02a98f383b5c96ecf3981e53 /httemplate/edit
parent338485d75b27ea0e5ab561856720633f890374c4 (diff)
RT# 80488 Live look up of WA state tax district
When conf flag 'tax_district_method' is set, tax district is queried for address before form is submitted Affected Pages: * New Customer * Edit Customer * Order Package * Change Package * Edit Package Location
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-xhttemplate/edit/cust_location.cgi13
-rw-r--r--httemplate/edit/cust_main/bottomfixup.js5
2 files changed, 17 insertions, 1 deletions
diff --git a/httemplate/edit/cust_location.cgi b/httemplate/edit/cust_location.cgi
index 38816db7a..93311c5c3 100755
--- a/httemplate/edit/cust_location.cgi
+++ b/httemplate/edit/cust_location.cgi
@@ -17,10 +17,21 @@ ACTION="<% $p %>edit/process/cust_location.cgi" METHOD=POST>
&>
<& /elements/standardize_locations.html,
'form' => 'EditLocationForm',
- 'callback' => 'document.EditLocationForm.submit();',
+ 'callback' => $conf->exists('tax_district_method')
+ ? 'wa_state_tax_district()'
+ : 'submit_continue()',
'with_census' => 1,
'with_census_functions' => 1,
&>
+<script>
+ <& /elements/wa_state_tax_district.js &>
+
+ // wa_sate_tax_district() will call submit_continue() upon success,
+ // or submit_abort() upon error
+ function submit_continue() {
+ document.EditLocationForm.submit();
+ }
+</script>
</TABLE>
<BR>
diff --git a/httemplate/edit/cust_main/bottomfixup.js b/httemplate/edit/cust_main/bottomfixup.js
index 97816aad7..d2a277b2f 100644
--- a/httemplate/edit/cust_main/bottomfixup.js
+++ b/httemplate/edit/cust_main/bottomfixup.js
@@ -7,6 +7,9 @@ my $company_longitude = $conf->config('company_longitude');
my @fixups = ('standardize_locations');
+push @fixups, 'wa_state_tax_district'
+ if $conf->exists('tax_district_method');
+
push @fixups, 'confirm_censustract_bill', 'confirm_censustract_ship'
if $conf->exists('cust_main-require_censustract');
@@ -57,6 +60,8 @@ function do_submit() {
'with_census' => 1, # no with_firm, apparently
&>
+<& /elements/wa_state_tax_district.js &>
+
% # the value in pre+'censustract' is the confirmed censustract (either from
% # the previous saved record, or from address standardization (if the backend
% # supports it), or from an aborted previous submit. only need to reconfirm