Skip to content

Commit

Permalink
Merge branch 'hotfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
vjFaLk committed Jan 26, 2018
2 parents b3e2493 + a267671 commit ea423d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion erpnext_taxjar/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

__version__ = '3.0.3'
__version__ = '3.0.4'

12 changes: 10 additions & 2 deletions erpnext_taxjar/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,15 @@ def get_tax_data(doc):
if tax.account_head == "Freight and Forwarding Charges - JA":
shipping = tax.tax_amount

shipping_state = validate_state(shipping_address)
country_code = frappe.db.get_value("Country", shipping_address.country, "code")
country_code = frappe.db.get_value(
"Country", shipping_address.country, "code")
country_code = country_code.upper()

if country_code != "US":
return

shipping_state = validate_state(shipping_address)

tax_dict = {
'to_country': country_code,
'to_zip': shipping_address.pincode,
Expand Down Expand Up @@ -142,6 +147,9 @@ def set_sales_tax(doc, method):
tax_account_head = frappe.db.get_single_value("TaxJar Settings", "tax_account_head")
tax_dict = get_tax_data(doc)

if not tax_dict:
return

tax_data = validate_tax_request(tax_dict)
if not tax_data.amount_to_collect:
taxes_list = []
Expand Down

0 comments on commit ea423d1

Please sign in to comment.