Skip to content

Commit

Permalink
resolved tax group rate issue for CA (#476)
Browse files Browse the repository at this point in the history
* resolved tax group rate issue for CA

* comment resolved
  • Loading branch information
Ashutosh619-sudo authored Jan 9, 2024
1 parent 9a780ea commit e3e75cd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/netsuite/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -902,9 +902,13 @@ def sync_tax_items(self):
for tax_groups in tax_groups_generator:
for tax_group in tax_groups:
if not tax_group['isInactive'] and tax_group['itemId']:
if tax_group['nexusCountry'] and tax_group['nexusCountry']['internalId'] == 'CA':
unit_price1 = float(tax_group['unitprice1'][:-1] if tax_group['unitprice1'] else 0)
unit_price2 = float(tax_group['unitprice2'][:-1] if tax_group['unitprice2'] else 0)
tax_rate = unit_price1 + unit_price2
else:
tax_rate = float(tax_group['rate'] if tax_group['rate'] else 0)
tax_type = tax_group['taxType']['name'] if tax_group['taxType'] else None
tax_rate = float(tax_group['rate'] if tax_group['rate'] else 0)

value = self.get_tax_code_name(tax_group['itemId'], tax_type, tax_rate)
if tax_rate >= 0:
attributes.append({
Expand Down

0 comments on commit e3e75cd

Please sign in to comment.