fix: fetching of item tax from hsn code (#26736)

* fix: fetching of item tax from hsn code
This commit is contained in:
Saqib
2021-08-03 15:57:11 +05:30
committed by GitHub
parent b4784493c9
commit 3a50490c04
5 changed files with 34 additions and 16 deletions

View File

@@ -859,4 +859,15 @@ def get_depreciation_amount(asset, depreciable_value, row):
depreciation_amount = flt(depreciable_value * (flt(rate_of_depreciation) / 100))
return depreciation_amount
return depreciation_amount
def set_item_tax_from_hsn_code(item):
if not item.taxes and item.gst_hsn_code:
hsn_doc = frappe.get_doc("GST HSN Code", item.gst_hsn_code)
for tax in hsn_doc.taxes:
item.append('taxes', {
'item_tax_template': tax.item_tax_template,
'tax_category': tax.tax_category,
'valid_from': tax.valid_from
})