feat: HSN wise tax breakup check in GST Settings
diff --git a/erpnext/regional/doctype/gst_settings/gst_settings.json b/erpnext/regional/doctype/gst_settings/gst_settings.json
index 95b930c..1dc30e4 100644
--- a/erpnext/regional/doctype/gst_settings/gst_settings.json
+++ b/erpnext/regional/doctype/gst_settings/gst_settings.json
@@ -8,6 +8,7 @@
   "gst_summary",
   "column_break_2",
   "round_off_gst_values",
+  "hsn_wise_tax_breakup",
   "gstin_email_sent_on",
   "section_break_4",
   "gst_accounts",
@@ -17,37 +18,27 @@
   {
    "fieldname": "gst_summary",
    "fieldtype": "HTML",
-   "label": "GST Summary",
-   "show_days": 1,
-   "show_seconds": 1
+   "label": "GST Summary"
   },
   {
    "fieldname": "column_break_2",
-   "fieldtype": "Column Break",
-   "show_days": 1,
-   "show_seconds": 1
+   "fieldtype": "Column Break"
   },
   {
    "fieldname": "gstin_email_sent_on",
    "fieldtype": "Date",
    "label": "GSTIN Email Sent On",
-   "read_only": 1,
-   "show_days": 1,
-   "show_seconds": 1
+   "read_only": 1
   },
   {
    "fieldname": "section_break_4",
-   "fieldtype": "Section Break",
-   "show_days": 1,
-   "show_seconds": 1
+   "fieldtype": "Section Break"
   },
   {
    "fieldname": "gst_accounts",
    "fieldtype": "Table",
    "label": "GST Accounts",
-   "options": "GST Account",
-   "show_days": 1,
-   "show_seconds": 1
+   "options": "GST Account"
   },
   {
    "default": "250000",
@@ -56,24 +47,26 @@
    "fieldtype": "Data",
    "in_list_view": 1,
    "label": "B2C Limit",
-   "reqd": 1,
-   "show_days": 1,
-   "show_seconds": 1
+   "reqd": 1
   },
   {
    "default": "0",
    "description": "Enabling this option will round off individual GST components in all the Invoices",
    "fieldname": "round_off_gst_values",
    "fieldtype": "Check",
-   "label": "Round Off GST Values",
-   "show_days": 1,
-   "show_seconds": 1
+   "label": "Round Off GST Values"
+  },
+  {
+   "default": "0",
+   "fieldname": "hsn_wise_tax_breakup",
+   "fieldtype": "Check",
+   "label": "HSN Wise Tax Breakup "
   }
  ],
  "index_web_pages_for_search": 1,
  "issingle": 1,
  "links": [],
- "modified": "2021-01-28 17:19:47.969260",
+ "modified": "2021-10-11 15:52:05.250159",
  "modified_by": "Administrator",
  "module": "Regional",
  "name": "GST Settings",
@@ -83,4 +76,4 @@
  "sort_field": "modified",
  "sort_order": "DESC",
  "track_changes": 1
-   }
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py
index 9493614..0e41280 100644
--- a/erpnext/regional/india/utils.py
+++ b/erpnext/regional/india/utils.py
@@ -112,7 +112,11 @@
 		frappe.throw(_("""Invalid {0}! The check digit validation has failed. Please ensure you've typed the {0} correctly.""").format(label))
 
 def get_itemised_tax_breakup_header(item_doctype, tax_accounts):
-	return [_("Item"), _("Taxable Amount")] + tax_accounts
+	hsn_wise_in_gst_settings = frappe.db.get_single_value('GST Settings','hsn_wise_tax_breakup')
+	if frappe.get_meta(item_doctype).has_field('gst_hsn_code') and hsn_wise_in_gst_settings:
+		return [_("HSN/SAC"), _("Taxable Amount")] + tax_accounts
+	else:
+		return [_("Item"), _("Taxable Amount")] + tax_accounts
 
 def get_itemised_tax_breakup_data(doc, account_wise=False, hsn_wise=False):
 	itemised_tax = get_itemised_tax(doc.taxes, with_tax_account=account_wise)
@@ -122,14 +126,17 @@
 	if not frappe.get_meta(doc.doctype + " Item").has_field('gst_hsn_code'):
 		return itemised_tax, itemised_taxable_amount
 
-	if hsn_wise:
+	hsn_wise_in_gst_settings = frappe.db.get_single_value('GST Settings','hsn_wise_tax_breakup')
+
+	tax_breakup_hsn_wise = hsn_wise or hsn_wise_in_gst_settings
+	if tax_breakup_hsn_wise:
 		item_hsn_map = frappe._dict()
 		for d in doc.items:
 			item_hsn_map.setdefault(d.item_code or d.item_name, d.get("gst_hsn_code"))
 
 	hsn_tax = {}
 	for item, taxes in itemised_tax.items():
-		item_or_hsn = item if not hsn_wise else item_hsn_map.get(item)
+		item_or_hsn = item if not tax_breakup_hsn_wise else item_hsn_map.get(item)
 		hsn_tax.setdefault(item_or_hsn, frappe._dict())
 		for tax_desc, tax_detail in taxes.items():
 			key = tax_desc
@@ -142,7 +149,7 @@
 	# set taxable amount
 	hsn_taxable_amount = frappe._dict()
 	for item in itemised_taxable_amount:
-		item_or_hsn = item if not hsn_wise else item_hsn_map.get(item)
+		item_or_hsn = item if not tax_breakup_hsn_wise else item_hsn_map.get(item)
 		hsn_taxable_amount.setdefault(item_or_hsn, 0)
 		hsn_taxable_amount[item_or_hsn] += itemised_taxable_amount.get(item)