diff --git a/netforce_clinic/models/report_cycle_item.py b/netforce_clinic/models/report_cycle_item.py index c7784e0..2f7492c 100644 --- a/netforce_clinic/models/report_cycle_item.py +++ b/netforce_clinic/models/report_cycle_item.py @@ -109,7 +109,7 @@ class ReportCycleItem(Model): 'dname': doctor.name or "", 'date': hdcase.date, 'epo': hdcase.epo, - 'fee': hdcase.fee, + 'fee': abs(hdcase.fee), #XXX 'dlz_name': hdcase.dlz_name, 'dlz_use': dlz_use, 'dlz_id': hdcase.dlz_id, @@ -137,7 +137,9 @@ class ReportCycleItem(Model): nlines=[] index=0 old=[] + total_fee=0 for line in sorted(lines,key=lambda x:(x['date'],x['cseq'])): + total_fee+=line.get("fee",0) cid=line['cid'] if not cid in old: old.append(cid) @@ -157,6 +159,7 @@ class ReportCycleItem(Model): 'month': month_str, 'date_from': date_from, 'date_to': date_to, + 'total_fee': total_fee, } return data diff --git a/netforce_clinic/templates/report_cycle_item.hbs b/netforce_clinic/templates/report_cycle_item.hbs index 2975869..fdba8dd 100644 --- a/netforce_clinic/templates/report_cycle_item.hbs +++ b/netforce_clinic/templates/report_cycle_item.hbs @@ -12,7 +12,7 @@