Merge pull request #22574 from deepeshgarg007/uae_item_tax_fix
fix: Update item tax only if item code available
This commit is contained in:
commit
62181707ee
@ -11,14 +11,17 @@ def update_itemised_tax_data(doc):
|
|||||||
|
|
||||||
for row in doc.items:
|
for row in doc.items:
|
||||||
tax_rate = 0.0
|
tax_rate = 0.0
|
||||||
item_tax_rate = frappe.parse_json(row.item_tax_rate)
|
item_tax_rate = 0.0
|
||||||
|
|
||||||
|
if row.item_tax_rate:
|
||||||
|
item_tax_rate = frappe.parse_json(row.item_tax_rate)
|
||||||
|
|
||||||
# First check if tax rate is present
|
# First check if tax rate is present
|
||||||
# If not then look up in item_wise_tax_detail
|
# If not then look up in item_wise_tax_detail
|
||||||
if item_tax_rate:
|
if item_tax_rate:
|
||||||
for account, rate in iteritems(item_tax_rate):
|
for account, rate in iteritems(item_tax_rate):
|
||||||
tax_rate += rate
|
tax_rate += rate
|
||||||
elif itemised_tax.get(row.item_code):
|
elif row.item_code and itemised_tax.get(row.item_code):
|
||||||
tax_rate = sum([tax.get('tax_rate', 0) for d, tax in itemised_tax.get(row.item_code).items()])
|
tax_rate = sum([tax.get('tax_rate', 0) for d, tax in itemised_tax.get(row.item_code).items()])
|
||||||
|
|
||||||
row.tax_rate = flt(tax_rate, row.precision("tax_rate"))
|
row.tax_rate = flt(tax_rate, row.precision("tax_rate"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user