diff --git a/netforce_clinic/models/report_hd_case_summary.py b/netforce_clinic/models/report_hd_case_summary.py index 0764a98..b5586bc 100644 --- a/netforce_clinic/models/report_hd_case_summary.py +++ b/netforce_clinic/models/report_hd_case_summary.py @@ -151,9 +151,10 @@ class ReportHDCaseSummary(Model): dom_txt=set_default(dom,topic) ctx=set_ctx(dom,topic) items={} + qty=get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total'] item_vals={ 'month': month_str, - 'qty': get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total'], + 'qty': "{0:,.0f}".format(qty), 'link': 'clinic_report_cycle_item&%s'%dom_txt, } if hdcase_type!='completed': @@ -165,9 +166,10 @@ class ReportHDCaseSummary(Model): topic='topic2' dom_txt=set_default(dom,topic) ctx=set_ctx(dom,topic) + qty=get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total'] items[topic]={ 'month': prev_month_str, - 'qty': get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total'], + 'qty': "{0:,.0f}".format(qty), 'link': 'clinic_report_hd_case_detail&%s'%dom_txt, } @@ -175,9 +177,10 @@ class ReportHDCaseSummary(Model): dom_txt=set_default(dom,topic) ctx=set_ctx(dom,topic) # new patient of this month + qty=get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total'] items[topic]={ 'month': month_str, - 'qty': get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total'], + 'qty': "{0:,.0f}".format(qty), 'action': 'clinic_patient', 'link': 'clinic_report_hd_case_detail&%s'%dom_txt, } @@ -189,7 +192,7 @@ class ReportHDCaseSummary(Model): resign_qty=get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total'] items[topic]={ 'month': month_str, - 'qty': resign_qty, + 'qty': "{0:,.0f}".format(resign_qty), 'action': 'clinic_patient', 'link': 'clinic_report_hd_case_detail&%s'%dom_txt, } @@ -198,11 +201,9 @@ class ReportHDCaseSummary(Model): dom_txt=set_default(dom,topic) ctx=set_ctx(dom,topic) total_qty=get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total'] - items[topic]={ 'month': next_month_str, - #'qty': total_qty-resign_qty, - 'qty': total_qty, + 'qty': "{0:,.0f}".format(total_qty), 'action': 'clinic_patient', 'link': 'clinic_report_hd_case_detail&%s'%dom_txt, } @@ -223,7 +224,7 @@ class ReportHDCaseSummary(Model): qty=get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total'] items[topic]={ 'month': '', - 'qty': qty, + 'qty': "{0:,.0f}".format(qty), 'action': 'clinic_patient', 'link': 'clinic_report_hd_case_detail&%s'%dom_txt, } diff --git a/netforce_clinic/templates/report_hd_case_summary.hbs b/netforce_clinic/templates/report_hd_case_summary.hbs index fec2a65..017ee66 100644 --- a/netforce_clinic/templates/report_hd_case_summary.hbs +++ b/netforce_clinic/templates/report_hd_case_summary.hbs @@ -23,19 +23,14 @@ {{topic}} {{month}} เท่ากับ - {{#if qty}} - - + {{#ifeq qty '0'}} + + {{else}} + {{qty}} - {{else}} - - 0 - - {{/if}} - {{unit}} + {{/ifeq}} + {{unit}} {{/each}}