refactor: format value using standard formatters
diff --git a/erpnext/healthcare/utils.py b/erpnext/healthcare/utils.py
index 96282f5..6b495a4 100644
--- a/erpnext/healthcare/utils.py
+++ b/erpnext/healthcare/utils.py
@@ -6,6 +6,7 @@
import math
import frappe
from frappe import _
+from frappe.utils.formatters import format_value
from frappe.utils import time_diff_in_hours, rounded
from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_income_account
from erpnext.healthcare.doctype.fee_validity.fee_validity import create_fee_validity
@@ -642,11 +643,15 @@
html += "<table class='table table-condensed table-bordered'>" \
+ table_head + table_row + "</table>"
continue
+
#on other field types add label and value to html
if not df.hidden and not df.print_hide and doc.get(df.fieldname) and df.fieldname not in exclude_fields:
- html += '<br>{0} : {1}'.format(df.label or df.fieldname, \
- doc.get(df.fieldname))
+ if doc.get(df.fieldname):
+ formatted_value = format_value(doc.get(df.fieldname), meta.get_field(df.fieldname), doc)
+ html += '<br>{0} : {1}'.format(df.label or df.fieldname, formatted_value)
+
if not has_data : has_data = True
+
if sec_on and col_on and has_data:
doc_html += section_html + html + '</div></div>'
elif sec_on and not col_on and has_data: