diff --git a/netforce_clinic/models/report_hd_case_summary.py b/netforce_clinic/models/report_hd_case_summary.py index ddb8dfe..0bc4396 100644 --- a/netforce_clinic/models/report_hd_case_summary.py +++ b/netforce_clinic/models/report_hd_case_summary.py @@ -105,6 +105,12 @@ class ReportHDCaseSummary(Model): dom=dom.replace("True","true") return dom.replace("'","\"") + def rzero(n): + if not n: + return '' + n="{0:,.0f}".format(n) + return n + def set_default(dom=[],topic='topic1'): dom_txt='' for f,op,v in dom: @@ -154,7 +160,7 @@ class ReportHDCaseSummary(Model): qty=get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total'] item_vals={ 'month': month_str, - 'qty': "{0:,.0f}".format(qty), + 'qty': rzero(qty), 'link': 'clinic_report_cycle_item&%s'%dom_txt, } if hdcase_type!='completed': @@ -169,7 +175,7 @@ class ReportHDCaseSummary(Model): qty=get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total'] items[topic]={ 'month': prev_month_str, - 'qty': "{0:,.0f}".format(qty), + 'qty': rzero(qty), 'link': 'clinic_report_hd_case_detail&%s'%dom_txt, } @@ -180,7 +186,7 @@ class ReportHDCaseSummary(Model): qty=get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total'] items[topic]={ 'month': month_str, - 'qty': "{0:,.0f}".format(qty), + 'qty': rzero(qty), 'action': 'clinic_patient', 'link': 'clinic_report_hd_case_detail&%s'%dom_txt, } @@ -192,7 +198,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': "{0:,.0f}".format(resign_qty), + 'qty': rzero(resign_qty), 'action': 'clinic_patient', 'link': 'clinic_report_hd_case_detail&%s'%dom_txt, } @@ -203,7 +209,7 @@ class ReportHDCaseSummary(Model): total_qty=get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total'] items[topic]={ 'month': next_month_str, - 'qty': "{0:,.0f}".format(total_qty), + 'qty': rzero(total_qty), 'action': 'clinic_patient', 'link': 'clinic_report_hd_case_detail&%s'%dom_txt, } @@ -224,7 +230,7 @@ class ReportHDCaseSummary(Model): qty=get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total'] items[topic]={ 'month': '', - 'qty': "{0:,.0f}".format(qty), + 'qty': rzero(qty), 'action': 'clinic_patient', 'link': 'clinic_report_hd_case_detail&%s'%dom_txt, } diff --git a/netforce_clinic/reports/report_hd_case_summary.xlsx b/netforce_clinic/reports/report_hd_case_summary.xlsx index ff24b7a..2ef2990 100644 Binary files a/netforce_clinic/reports/report_hd_case_summary.xlsx and b/netforce_clinic/reports/report_hd_case_summary.xlsx differ