Invoice copy, state code in gst print format, hsn code in other sales/purchase docs (#9658)

* Invoice copy, state code in gst print format, hsn code in other sales/purchase docs

* Formatted Net Amount in item-tax-breakup

* GST print format fixes

* removed trailing whitespace

* removed trailing whitespace
This commit is contained in:
Nabin Hait
2017-07-06 14:49:34 +05:30
committed by Makarand Bauskar
parent 5d5a81f375
commit f3f0dfef2a
12 changed files with 74 additions and 36 deletions

View File

@@ -7,6 +7,7 @@ def validate_gstin_for_india(doc, method):
return
if doc.gstin:
doc.gstin = doc.gstin.upper()
if doc.gstin != "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}")
if not p.match(doc.gstin):
@@ -17,6 +18,7 @@ def validate_gstin_for_india(doc, method):
doc.gst_state = doc.state
if doc.gst_state:
state_number = state_numbers[doc.gst_state]
if state_number != doc.gstin[:2]:
frappe.throw(_("First 2 digits of GSTIN should match with State number {0}").format(state_number))
doc.gst_state_number = state_numbers[doc.gst_state]
if 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))