From de82ad1c5fefd7652f75f4f3652c957ce033da8f Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 7 Jun 2018 13:20:57 +0530 Subject: [PATCH] [Fix] Clenaup code if supplier gstin is none --- erpnext/regional/india/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py index f887841cd0..f12f54b1da 100644 --- a/erpnext/regional/india/utils.py +++ b/erpnext/regional/india/utils.py @@ -83,7 +83,6 @@ def get_place_of_supply(out, doctype): return cstr(address.gst_state_number) + "-" + cstr(address.gst_state) def get_regional_address_details(out, doctype, company): - out.place_of_supply = get_place_of_supply(out, doctype) if not out.place_of_supply: return @@ -97,8 +96,9 @@ def get_regional_address_details(out, doctype, company): if not (out.supplier_gstin or out.place_of_supply): return - if doctype in ("Sales Invoice", "Delivery Note") and out.company_gstin[:2] != out.place_of_supply[:2]\ - or (doctype == "Purchase Invoice" and out.supplier_gstin[:2] != out.place_of_supply[:2]): + if ((doctype in ("Sales Invoice", "Delivery Note") and out.company_gstin + and out.company_gstin[:2] != out.place_of_supply[:2]) or (doctype == "Purchase Invoice" + and out.supplier_gstin and out.supplier_gstin[:2] != out.place_of_supply[:2])): default_tax = frappe.db.get_value(master_doctype, {"company": company, "is_inter_state":1, "disabled":0}) else: default_tax = frappe.db.get_value(master_doctype, {"company": company, "disabled":0, "is_default": 1})