From 80a13c38bc5ecb763c8de46c2f39fc602665ce5e Mon Sep 17 00:00:00 2001 From: maharshivpatel <39730881+maharshivpatel@users.noreply.github.com> Date: Mon, 2 May 2022 21:51:27 +0530 Subject: [PATCH] fix(india): e-invoice generation for registered composition gst category type (#30814) --- erpnext/regional/india/e_invoice/utils.py | 10 +++++++--- erpnext/regional/india/setup.py | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/erpnext/regional/india/e_invoice/utils.py b/erpnext/regional/india/e_invoice/utils.py index 0aff495f27..df3981a5e9 100644 --- a/erpnext/regional/india/e_invoice/utils.py +++ b/erpnext/regional/india/e_invoice/utils.py @@ -57,6 +57,7 @@ def validate_eligibility(doc): invalid_company = not frappe.db.get_value("E Invoice User", {"company": doc.get("company")}) invalid_supply_type = doc.get("gst_category") not in [ "Registered Regular", + "Registered Composition", "SEZ", "Overseas", "Deemed Export", @@ -124,7 +125,9 @@ def read_json(name): def get_transaction_details(invoice): supply_type = "" - if invoice.gst_category == "Registered Regular": + if ( + invoice.gst_category == "Registered Regular" or invoice.gst_category == "Registered Composition" + ): supply_type = "B2B" elif invoice.gst_category == "SEZ": if invoice.export_type == "Without Payment of Tax": @@ -140,14 +143,15 @@ def get_transaction_details(invoice): supply_type = "DEXP" if not supply_type: - rr, sez, overseas, export = ( + rr, rc, sez, overseas, export = ( bold("Registered Regular"), + bold("Registered Composition"), bold("SEZ"), bold("Overseas"), bold("Deemed Export"), ) frappe.throw( - _("GST category should be one of {}, {}, {}, {}").format(rr, sez, overseas, export), + _("GST category should be one of {}, {}, {}, {}, {}").format(rr, rc, sez, overseas, export), title=_("Invalid Supply Type"), ) diff --git a/erpnext/regional/india/setup.py b/erpnext/regional/india/setup.py index 062c2ef5c5..e41cd34c72 100644 --- a/erpnext/regional/india/setup.py +++ b/erpnext/regional/india/setup.py @@ -762,7 +762,7 @@ def get_custom_fields(): insert_after="customer", no_copy=1, print_hide=1, - depends_on='eval:in_list(["Registered Regular", "SEZ", "Overseas", "Deemed Export"], doc.gst_category) && doc.irn_cancelled === 0', + depends_on='eval:in_list(["Registered Regular", "Registered Composition", "SEZ", "Overseas", "Deemed Export"], doc.gst_category) && doc.irn_cancelled === 0', ), dict( fieldname="irn_cancelled",