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

* fix: fetching of item tax from hsn code

(cherry picked from commit 3a50490c04398c30663cab77f722153ec0b220e1)

Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py
index 04db9b3..ac195a6 100644
--- a/erpnext/regional/india/utils.py
+++ b/erpnext/regional/india/utils.py
@@ -851,4 +851,15 @@
 
 		depreciation_amount = flt(depreciable_value * (flt(rate_of_depreciation) / 100))
 
-	return depreciation_amount
\ No newline at end of file
+	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
+			})
\ No newline at end of file