Skip to content

Commit

Permalink
Merge pull request #118 from phalouvas/bug/unk
Browse files Browse the repository at this point in the history
  • Loading branch information
phalouvas authored Jan 3, 2025
2 parents 1550562 + f3bdfa2 commit 206fe84
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion swissmedhealth/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '4.9.7'
__version__ = '4.9.8'
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,28 @@ <h2>Personal Details</h2>
{% set contact_list = frappe.get_list(
"Contact",
filters=[
["Dynamic Link", "link_doctype", "=", doc.doctype],
["Dynamic Link", "link_name", "=", doc.name],
["Dynamic Link", "link_doctype", "=", active_doc.doctype or ""],
["Dynamic Link", "link_name", "=", active_doc.name or ""],
["Dynamic Link", "parenttype", "=", "Contact"],
"is_primary_contact = 0",
["is_primary_contact", "=", 0],
],
fields=["full_name", "phone"],
order_by="is_primary_contact DESC, `tabContact`.creation ASC",
) %}
{% if contact_list and contact_list[0].phone != active_doc.phone %}
<table class="table table-bordered">
<tr>
<td colspan="6">Emergency Contact <b>{{ contact_list[0].full_name }}</b></td>
<td style="max-width: 20rem;" colspan="6">Emergency Contact <b>{{ contact_list[0].full_name }}</b></td>
<td colspan="3">Phone <b>{{ contact_list[0].phone }}</b></td>
</tr>
</table>
{% else %}
<table class="table table-bordered">
<tr>
<td style="max-width: 20rem;" colspan="6">Emergency Contact</td>
<td colspan="3">Phone</td>
</tr>
</table>
{% endif %}

{% set active_doc = frappe.get_doc("Medical History", doc.custom_medical_history) %}
Expand Down

0 comments on commit 206fe84

Please sign in to comment.