mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 03:09:09 +00:00
feat: Basic validation for indian PAN No. in Supplier (#24687)
This commit is contained in:
@@ -55,6 +55,14 @@ def validate_gstin_for_india(doc, method):
|
||||
frappe.throw(_("Invalid GSTIN! First 2 digits of GSTIN should match with State number {0}.")
|
||||
.format(doc.gst_state_number))
|
||||
|
||||
def validate_pan_for_india(doc, method):
|
||||
if doc.get('country') != 'India':
|
||||
return
|
||||
|
||||
p = re.compile("[A-Z]{5}[0-9]{4}[A-Z]{1}")
|
||||
if not p.match(doc.pan):
|
||||
frappe.throw(_("Invalid PAN No. The input you've entered doesn't match the format of PAN."))
|
||||
|
||||
def validate_tax_category(doc, method):
|
||||
if doc.get('gst_state') and frappe.db.get_value('Tax Category', {'gst_state': doc.gst_state, 'is_inter_state': doc.is_inter_state}):
|
||||
if doc.is_inter_state:
|
||||
|
||||
Reference in New Issue
Block a user