Skip to content

Commit

Permalink
fix(india): e-invoice generation is required for registered compositi…
Browse files Browse the repository at this point in the history
…on gst category type

Sales Invoice for Buyer with GST Category "Registered Composition" is also B2B Transaction and e-invoice generation is mandatory (required) in this case.
  • Loading branch information
maharshivpatel committed Apr 26, 2022
1 parent dcc2243 commit bada35e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions erpnext/regional/india/e_invoice/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -124,7 +125,7 @@ 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":
supply_type = "SEZWOP"
Expand All @@ -134,14 +135,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"),
)

Expand Down
2 changes: 1 addition & 1 deletion erpnext/regional/india/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit bada35e

Please sign in to comment.