diff --git a/erpnext/templates/pages/regional/india/update-gstin.html b/erpnext/templates/pages/regional/india/update-gstin.html index 5c4f7ae8d3..3d9ab5d125 100644 --- a/erpnext/templates/pages/regional/india/update-gstin.html +++ b/erpnext/templates/pages/regional/india/update-gstin.html @@ -5,8 +5,16 @@ {% block header %}

Update GSTIN

{% endblock %} {% block page_content %} -

{{ party.name }}

-{% if invalid_gstin %} +

{{ party_name }}

+{% if not_found %} +

+ Company Not Found +

+

+ If this problem persists, please contact the company. +

+ +{% elif invalid_gstin %}

Invalid GSTIN

diff --git a/erpnext/templates/pages/regional/india/update_gstin.py b/erpnext/templates/pages/regional/india/update_gstin.py index 0d4ec37ef7..9d8d22e42a 100644 --- a/erpnext/templates/pages/regional/india/update_gstin.py +++ b/erpnext/templates/pages/regional/india/update_gstin.py @@ -4,6 +4,7 @@ from frappe import _ def get_context(context): context.no_cache = 1 party = frappe.form_dict.party + context.party_name = party try: update_gstin(context) @@ -11,14 +12,15 @@ def get_context(context): context.invalid_gstin = 1 party_type = 'Customer' - party = frappe.db.get_value('Customer', party) + party_name = frappe.db.get_value('Customer', party) - if not party: + if not party_name: party_type = 'Supplier' - party = frappe.db.get_value('Supplier', party) + party_name = frappe.db.get_value('Supplier', party) - if not party: - frappe.throw(_("Not Found"), frappe.DoesNotExistError) + if not party_name: + context.not_found = 1 + return context.party = frappe.get_doc(party_type, party) context.party.onload()