Gst number validation fix

This commit is contained in:
Himanshu 2019-01-03 12:50:18 +05:30 committed by GitHub
parent a09a6e4020
commit 53c040f838
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,7 +11,7 @@ def validate_gstin_for_india(doc, method):
if doc.gstin: if doc.gstin:
doc.gstin = doc.gstin.upper() doc.gstin = doc.gstin.upper()
if doc.gstin not in ["NA", "na"]: if doc.gstin not in ["NA", "na"]:
p = re.compile("[0-9]{2}[a-zA-Z]{5}[0-9]{4}[a-zA-Z]{1}[1-9A-Za-z]{1}[Z]{1}[0-9a-zA-Z]{1}") p = re.compile("[0-9]{2}[0-9A-Za-z]{10}[0-9A-Za-z]{1}[0-9a-zA-Z]{1}[0-9a-zA-Z]{1}")
if not p.match(doc.gstin): if not p.match(doc.gstin):
frappe.throw(_("Invalid GSTIN or Enter NA for Unregistered")) frappe.throw(_("Invalid GSTIN or Enter NA for Unregistered"))