[fix] update-gstin
This commit is contained in:
parent
0018db344c
commit
02b0ed4199
@ -5,8 +5,16 @@
|
|||||||
{% block header %}<h2>Update GSTIN</h2>{% endblock %}
|
{% block header %}<h2>Update GSTIN</h2>{% endblock %}
|
||||||
|
|
||||||
{% block page_content %}
|
{% block page_content %}
|
||||||
<h3>{{ party.name }}</h3>
|
<h3>{{ party_name }}</h3>
|
||||||
{% if invalid_gstin %}
|
{% if not_found %}
|
||||||
|
<p class='alert alert-danger' style='max-width: 300px;'>
|
||||||
|
Company Not Found
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
If this problem persists, please contact the company.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
{% elif invalid_gstin %}
|
||||||
<p class='alert alert-danger' style='max-width: 300px;'>
|
<p class='alert alert-danger' style='max-width: 300px;'>
|
||||||
Invalid GSTIN
|
Invalid GSTIN
|
||||||
</p>
|
</p>
|
||||||
|
@ -4,6 +4,7 @@ from frappe import _
|
|||||||
def get_context(context):
|
def get_context(context):
|
||||||
context.no_cache = 1
|
context.no_cache = 1
|
||||||
party = frappe.form_dict.party
|
party = frappe.form_dict.party
|
||||||
|
context.party_name = party
|
||||||
|
|
||||||
try:
|
try:
|
||||||
update_gstin(context)
|
update_gstin(context)
|
||||||
@ -11,14 +12,15 @@ def get_context(context):
|
|||||||
context.invalid_gstin = 1
|
context.invalid_gstin = 1
|
||||||
|
|
||||||
party_type = 'Customer'
|
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_type = 'Supplier'
|
||||||
party = frappe.db.get_value('Supplier', party)
|
party_name = frappe.db.get_value('Supplier', party)
|
||||||
|
|
||||||
if not party:
|
if not party_name:
|
||||||
frappe.throw(_("Not Found"), frappe.DoesNotExistError)
|
context.not_found = 1
|
||||||
|
return
|
||||||
|
|
||||||
context.party = frappe.get_doc(party_type, party)
|
context.party = frappe.get_doc(party_type, party)
|
||||||
context.party.onload()
|
context.party.onload()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user