[minor] Code cleanup (#12278)
This commit is contained in:
parent
2640c7eec5
commit
526b0bc4e9
@ -7,7 +7,9 @@ def update_itemised_tax_data(doc):
|
||||
itemised_tax = get_itemised_tax(doc.taxes)
|
||||
|
||||
for row in doc.items:
|
||||
tax_rate = sum([tax.get('tax_rate', 0) for d, tax in itemised_tax.get(row.item_code).items()])
|
||||
tax_rate = 0.0
|
||||
if 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()])
|
||||
|
||||
row.tax_rate = flt(tax_rate, row.precision("tax_rate"))
|
||||
row.tax_amount = flt((row.net_amount * tax_rate) / 100, row.precision("net_amount"))
|
||||
|
Loading…
x
Reference in New Issue
Block a user