summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorjeff <jeff>2009-02-20 15:07:10 +0000
committerjeff <jeff>2009-02-20 15:07:10 +0000
commitbc73aa9d59454c87b2e5deecfff07dcd57fca954 (patch)
tree44d6e39810aaea766207a38388dfaf0e9382b05b /httemplate/edit
parentd119d4bc4b5f3f717c90d905a95f4de788c0e892 (diff)
support a default tax location outside us/ca with cch data and better handling of response from USPS (RT 4857)
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-xhttemplate/edit/cust_main.cgi22
1 files changed, 15 insertions, 7 deletions
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi
index 3fb70a5bf..d3004f1c6 100755
--- a/httemplate/edit/cust_main.cgi
+++ b/httemplate/edit/cust_main.cgi
@@ -361,16 +361,23 @@ function update_address(arg) {
% if ( $conf->exists('enable_taxproducts') ) {
- if ( ( error || ship_error ) &&
- ( document.bottomform.elements['country'].value == 'CA' ||
+ if ( <% $taxpre %>error ) {
+
+ if ( document.bottomform.elements['country'].value == 'CA' ||
document.bottomform.elements['country'].value == 'US'
)
- )
- {
+ {
+
+ var url = "cust_main/choose_tax_location.html?data_vendor=cch-zip;city="+document.bottomform.elements['city'].value+";state="+document.bottomform.elements['state'].value+";zip="+document.bottomform.elements['zip'].value+";country="+document.bottomform.elements['country'].value+";";
+ // popup a chooser
+ OLgetAJAX( url, update_geocode, 300 );
+
+ } else {
+
+ document.bottomform.elements['geocode'].value = 'DEFAULT';
+ document.bottomform.submit();
- var url = "cust_main/choose_tax_location.html?data_vendor=cch-zip;city="+document.bottomform.elements['city'].value+";state="+document.bottomform.elements['state'].value+";zip="+document.bottomform.elements['zip'].value+";country="+document.bottomform.elements['country'].value+";";
- // popup a chooser
- OLgetAJAX( url, update_geocode, 300 );
+ }
} else
@@ -690,6 +697,7 @@ die "access denied"
my $conf = new FS::Conf;
+my $taxpre = $conf->exists('tax-ship_address') ? 'ship_' : '';
#get record
my($custnum, $username, $password, $popnum, $cust_main, $saved_pkgpart, $saved_domsvc);