format thoundsan

conv_bal
watcha.h@almacom.co.th 2015-05-08 21:54:03 +07:00
parent 4d6ebbfec6
commit b778aa3aad
2 changed files with 15 additions and 19 deletions

View File

@ -151,9 +151,10 @@ class ReportHDCaseSummary(Model):
dom_txt=set_default(dom,topic) dom_txt=set_default(dom,topic)
ctx=set_ctx(dom,topic) ctx=set_ctx(dom,topic)
items={} items={}
qty=get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total']
item_vals={ item_vals={
'month': month_str, '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, 'link': 'clinic_report_cycle_item&%s'%dom_txt,
} }
if hdcase_type!='completed': if hdcase_type!='completed':
@ -165,9 +166,10 @@ class ReportHDCaseSummary(Model):
topic='topic2' topic='topic2'
dom_txt=set_default(dom,topic) dom_txt=set_default(dom,topic)
ctx=set_ctx(dom,topic) ctx=set_ctx(dom,topic)
qty=get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total']
items[topic]={ items[topic]={
'month': prev_month_str, '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, 'link': 'clinic_report_hd_case_detail&%s'%dom_txt,
} }
@ -175,9 +177,10 @@ class ReportHDCaseSummary(Model):
dom_txt=set_default(dom,topic) dom_txt=set_default(dom,topic)
ctx=set_ctx(dom,topic) ctx=set_ctx(dom,topic)
# new patient of this month # new patient of this month
qty=get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total']
items[topic]={ items[topic]={
'month': month_str, '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', 'action': 'clinic_patient',
'link': 'clinic_report_hd_case_detail&%s'%dom_txt, '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'] resign_qty=get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total']
items[topic]={ items[topic]={
'month': month_str, 'month': month_str,
'qty': resign_qty, 'qty': "{0:,.0f}".format(resign_qty),
'action': 'clinic_patient', 'action': 'clinic_patient',
'link': 'clinic_report_hd_case_detail&%s'%dom_txt, 'link': 'clinic_report_hd_case_detail&%s'%dom_txt,
} }
@ -198,11 +201,9 @@ class ReportHDCaseSummary(Model):
dom_txt=set_default(dom,topic) dom_txt=set_default(dom,topic)
ctx=set_ctx(dom,topic) ctx=set_ctx(dom,topic)
total_qty=get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total'] total_qty=get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total']
items[topic]={ items[topic]={
'month': next_month_str, 'month': next_month_str,
#'qty': total_qty-resign_qty, 'qty': "{0:,.0f}".format(total_qty),
'qty': total_qty,
'action': 'clinic_patient', 'action': 'clinic_patient',
'link': 'clinic_report_hd_case_detail&%s'%dom_txt, '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'] qty=get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total']
items[topic]={ items[topic]={
'month': '', 'month': '',
'qty': qty, 'qty': "{0:,.0f}".format(qty),
'action': 'clinic_patient', 'action': 'clinic_patient',
'link': 'clinic_report_hd_case_detail&%s'%dom_txt, 'link': 'clinic_report_hd_case_detail&%s'%dom_txt,
} }

View File

@ -23,19 +23,14 @@
<td>{{topic}}</td> <td>{{topic}}</td>
<td>{{month}}</td> <td>{{month}}</td>
<td>เท่ากับ</td> <td>เท่ากับ</td>
{{#if qty}} {{#ifeq qty '0'}}
<td> <td></td>
<!-- {{else}}
{{view "link" string=qty action=action action_options=action_options}} <td style="text-align:right;width:5%">
-->
<a href='/ui#name={{link}}' target="_blank">{{qty}}</a> <a href='/ui#name={{link}}' target="_blank">{{qty}}</a>
</td> </td>
{{else}} {{/ifeq}}
<td> <td style="text-align:center">{{unit}}</td>
0
</td>
{{/if}}
<td>{{unit}}</td>
</tr> </tr>
{{/each}} {{/each}}
</tbody> </tbody>