Update utils.py

This commit is contained in:
Nabin Hait 2017-07-08 13:52:13 +05:30 committed by GitHub
parent 0e285265b1
commit cd61a20fb4

View File

@ -17,8 +17,8 @@ def validate_gstin_for_india(doc, method):
if doc.state in states:
doc.gst_state = doc.state
if doc.gst_state and doc.gstin != "NA":
if doc.gst_state:
doc.gst_state_number = state_numbers[doc.gst_state]
if doc.gst_state_number != doc.gstin[:2]:
if doc.gstin != "NA" and doc.gst_state_number != doc.gstin[:2]:
frappe.throw(_("First 2 digits of GSTIN should match with State number {0}")
.format(doc.gst_state_number))
.format(doc.gst_state_number))