feat: HSN wise tax breakup check in GST Settings
This commit is contained in:
parent
7acdcc70ad
commit
530de12b07
@ -8,6 +8,7 @@
|
|||||||
"gst_summary",
|
"gst_summary",
|
||||||
"column_break_2",
|
"column_break_2",
|
||||||
"round_off_gst_values",
|
"round_off_gst_values",
|
||||||
|
"hsn_wise_tax_breakup",
|
||||||
"gstin_email_sent_on",
|
"gstin_email_sent_on",
|
||||||
"section_break_4",
|
"section_break_4",
|
||||||
"gst_accounts",
|
"gst_accounts",
|
||||||
@ -17,37 +18,27 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "gst_summary",
|
"fieldname": "gst_summary",
|
||||||
"fieldtype": "HTML",
|
"fieldtype": "HTML",
|
||||||
"label": "GST Summary",
|
"label": "GST Summary"
|
||||||
"show_days": 1,
|
|
||||||
"show_seconds": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "column_break_2",
|
"fieldname": "column_break_2",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break"
|
||||||
"show_days": 1,
|
|
||||||
"show_seconds": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "gstin_email_sent_on",
|
"fieldname": "gstin_email_sent_on",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"label": "GSTIN Email Sent On",
|
"label": "GSTIN Email Sent On",
|
||||||
"read_only": 1,
|
"read_only": 1
|
||||||
"show_days": 1,
|
|
||||||
"show_seconds": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "section_break_4",
|
"fieldname": "section_break_4",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break"
|
||||||
"show_days": 1,
|
|
||||||
"show_seconds": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "gst_accounts",
|
"fieldname": "gst_accounts",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"label": "GST Accounts",
|
"label": "GST Accounts",
|
||||||
"options": "GST Account",
|
"options": "GST Account"
|
||||||
"show_days": 1,
|
|
||||||
"show_seconds": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"default": "250000",
|
"default": "250000",
|
||||||
@ -56,24 +47,26 @@
|
|||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "B2C Limit",
|
"label": "B2C Limit",
|
||||||
"reqd": 1,
|
"reqd": 1
|
||||||
"show_days": 1,
|
|
||||||
"show_seconds": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"default": "0",
|
"default": "0",
|
||||||
"description": "Enabling this option will round off individual GST components in all the Invoices",
|
"description": "Enabling this option will round off individual GST components in all the Invoices",
|
||||||
"fieldname": "round_off_gst_values",
|
"fieldname": "round_off_gst_values",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Round Off GST Values",
|
"label": "Round Off GST Values"
|
||||||
"show_days": 1,
|
},
|
||||||
"show_seconds": 1
|
{
|
||||||
|
"default": "0",
|
||||||
|
"fieldname": "hsn_wise_tax_breakup",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "HSN Wise Tax Breakup "
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-01-28 17:19:47.969260",
|
"modified": "2021-10-11 15:52:05.250159",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Regional",
|
"module": "Regional",
|
||||||
"name": "GST Settings",
|
"name": "GST Settings",
|
||||||
@ -83,4 +76,4 @@
|
|||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"track_changes": 1
|
"track_changes": 1
|
||||||
}
|
}
|
@ -112,6 +112,10 @@ def validate_gstin_check_digit(gstin, label='GSTIN'):
|
|||||||
frappe.throw(_("""Invalid {0}! The check digit validation has failed. Please ensure you've typed the {0} correctly.""").format(label))
|
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):
|
def get_itemised_tax_breakup_header(item_doctype, 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
|
return [_("Item"), _("Taxable Amount")] + tax_accounts
|
||||||
|
|
||||||
def get_itemised_tax_breakup_data(doc, account_wise=False, hsn_wise=False):
|
def get_itemised_tax_breakup_data(doc, account_wise=False, hsn_wise=False):
|
||||||
@ -122,14 +126,17 @@ def get_itemised_tax_breakup_data(doc, account_wise=False, hsn_wise=False):
|
|||||||
if not frappe.get_meta(doc.doctype + " Item").has_field('gst_hsn_code'):
|
if not frappe.get_meta(doc.doctype + " Item").has_field('gst_hsn_code'):
|
||||||
return itemised_tax, itemised_taxable_amount
|
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()
|
item_hsn_map = frappe._dict()
|
||||||
for d in doc.items:
|
for d in doc.items:
|
||||||
item_hsn_map.setdefault(d.item_code or d.item_name, d.get("gst_hsn_code"))
|
item_hsn_map.setdefault(d.item_code or d.item_name, d.get("gst_hsn_code"))
|
||||||
|
|
||||||
hsn_tax = {}
|
hsn_tax = {}
|
||||||
for item, taxes in itemised_tax.items():
|
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())
|
hsn_tax.setdefault(item_or_hsn, frappe._dict())
|
||||||
for tax_desc, tax_detail in taxes.items():
|
for tax_desc, tax_detail in taxes.items():
|
||||||
key = tax_desc
|
key = tax_desc
|
||||||
@ -142,7 +149,7 @@ def get_itemised_tax_breakup_data(doc, account_wise=False, hsn_wise=False):
|
|||||||
# set taxable amount
|
# set taxable amount
|
||||||
hsn_taxable_amount = frappe._dict()
|
hsn_taxable_amount = frappe._dict()
|
||||||
for item in itemised_taxable_amount:
|
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.setdefault(item_or_hsn, 0)
|
||||||
hsn_taxable_amount[item_or_hsn] += itemised_taxable_amount.get(item)
|
hsn_taxable_amount[item_or_hsn] += itemised_taxable_amount.get(item)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user