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

* fix: fetching of item tax from hsn code

(cherry picked from commit 3a50490c04)

Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
This commit is contained in:
Frappe PR Bot
2021-08-06 10:59:29 +05:30
committed by GitHub
parent b13e46071a
commit 2e352834a2
5 changed files with 34 additions and 16 deletions

View File

@@ -851,4 +851,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
})