mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
feat(india): bulk e-invoice generation (#24969)
This commit is contained in:
@@ -41,24 +41,25 @@ def validate_gstin_for_india(doc, method):
|
||||
return
|
||||
|
||||
if len(doc.gstin) != 15:
|
||||
frappe.throw(_("Invalid GSTIN! A GSTIN must have 15 characters."))
|
||||
frappe.throw(_("A GSTIN must have 15 characters."), title=_("Invalid GSTIN"))
|
||||
|
||||
if gst_category and gst_category == 'UIN Holders':
|
||||
if not GSTIN_UIN_FORMAT.match(doc.gstin):
|
||||
frappe.throw(_("Invalid GSTIN! The input you've entered doesn't match the GSTIN format for UIN Holders or Non-Resident OIDAR Service Providers"))
|
||||
frappe.throw(_("The input you've entered doesn't match the GSTIN format for UIN Holders or Non-Resident OIDAR Service Providers"),
|
||||
title=_("Invalid GSTIN"))
|
||||
else:
|
||||
if not GSTIN_FORMAT.match(doc.gstin):
|
||||
frappe.throw(_("Invalid GSTIN! The input you've entered doesn't match the format of GSTIN."))
|
||||
frappe.throw(_("The input you've entered doesn't match the format of GSTIN."), title=_("Invalid GSTIN"))
|
||||
|
||||
validate_gstin_check_digit(doc.gstin)
|
||||
set_gst_state_and_state_number(doc)
|
||||
|
||||
if not doc.gst_state:
|
||||
frappe.throw(_("Please Enter GST state"))
|
||||
frappe.throw(_("Please enter GST state"), title=_("Invalid State"))
|
||||
|
||||
if doc.gst_state_number != doc.gstin[:2]:
|
||||
frappe.throw(_("Invalid GSTIN! First 2 digits of GSTIN should match with State number {0}.")
|
||||
.format(doc.gst_state_number))
|
||||
frappe.throw(_("First 2 digits of GSTIN should match with State number {0}.")
|
||||
.format(doc.gst_state_number), title=_("Invalid GSTIN"))
|
||||
|
||||
def validate_pan_for_india(doc, method):
|
||||
if doc.get('country') != 'India' or not doc.pan:
|
||||
|
||||
Reference in New Issue
Block a user