diff --git a/netforce_clinic/models/report_account_hd_case_summary.py b/netforce_clinic/models/report_account_hd_case_summary.py index 2878059..10a103c 100644 --- a/netforce_clinic/models/report_account_hd_case_summary.py +++ b/netforce_clinic/models/report_account_hd_case_summary.py @@ -321,6 +321,25 @@ class ReportAccountHDCaseSummary(Model): else: data['title']='Report - No Claim' data['title']='' #XXX + + categs={} + for line in lines: + if line.get('hdcase_id'): + hdcase_id=line['hdcase_id'] + hdcase=get_model("clinic.hd.case").browse(hdcase_id) + for line2 in hdcase.lines: + prod=line2.product_id + categ=line2.product_categ_id + if categ.code=='EPO': + categs.setdefault(prod.description, 0) + categs[prod.description]+=line2.qty or 0 + + data['categ_lines']=[] + for categ, qty in categs.items(): + data['categ_lines'].append({ + 'name': categ, + 'qty': qty, + }) return data def onchange_date(self,context={}): diff --git a/netforce_clinic/templates/report_account_hd_case_summary.hbs b/netforce_clinic/templates/report_account_hd_case_summary.hbs index 3d36ab0..c1071bf 100644 --- a/netforce_clinic/templates/report_account_hd_case_summary.hbs +++ b/netforce_clinic/templates/report_account_hd_case_summary.hbs @@ -8,7 +8,15 @@
+ {{#each categ_lines}} + {{name}}: {{qty}} + {{/each}} +
+ +