diff --git a/netforce_clinic/models/report_labor_cost.py b/netforce_clinic/models/report_labor_cost.py index 3f57db4..9e4bea0 100644 --- a/netforce_clinic/models/report_labor_cost.py +++ b/netforce_clinic/models/report_labor_cost.py @@ -207,8 +207,8 @@ class ReportLaborCost(Model): }) for dt_name,vals in ddata.items(): qty=vals['qty'] or 0 - department_id=vals['department_id'] - branch_id=vals['branch_id'] + dpt_id=vals['department_id'] + brch_id=vals['branch_id'] walkin_qty=vals['walkin_qty'] cost=(walkin_qty+qty)*cost_per_case dlines.append({ @@ -218,8 +218,8 @@ class ReportLaborCost(Model): 'total_qty': walkin_qty+qty, 'cost': cost, 'total': 0, - 'department_id': department_id, - 'branch_id': branch_id, + 'department_id': dpt_id, + 'branch_id': brch_id, 'staff_type': 'doctor', }) dlines=[{ @@ -261,15 +261,15 @@ class ReportLaborCost(Model): }) for dt_name, vals in ndata.items(): hdcases=vals['hdcases'] - department_id=vals['department_id'] - branch_id=vals['branch_id'] + dpt_id=vals['department_id'] + brch_id=vals['branch_id'] total_hdcase=len(hdcases) nlines.append({ 'name': dt_name, 'qty': total_hdcase, 'cost': total_hdcase*vark, - 'department_id': department_id, - 'branch_id': branch_id, + 'department_id': dpt_id, + 'branch_id': brch_id, 'total': 0, 'staff_type': 'nurse', }) diff --git a/netforce_clinic/models/report_labor_cost_summary.py b/netforce_clinic/models/report_labor_cost_summary.py index 8492151..cb0c7fb 100644 --- a/netforce_clinic/models/report_labor_cost_summary.py +++ b/netforce_clinic/models/report_labor_cost_summary.py @@ -64,6 +64,7 @@ class ReportLaborCostSummary(Model): 'categ_id': categ_id, 'level_id': level_id, } + print('res ', res) return res def get_report_data(self,ids,context={}): @@ -83,7 +84,7 @@ class ReportLaborCostSummary(Model): date_from=obj.date_from date_to=obj.date_to staff_id=obj.staff_id.id - staff_type=obj.staff_type + staff_type=obj.staff_type or "doctor" level_id=obj.level_id.id categ_id=obj.categ_id.id branch_id=obj.branch_id.id diff --git a/netforce_clinic/templates/report_labor_cost.hbs b/netforce_clinic/templates/report_labor_cost.hbs index d1c5fde..84ffe7e 100644 --- a/netforce_clinic/templates/report_labor_cost.hbs +++ b/netforce_clinic/templates/report_labor_cost.hbs @@ -147,7 +147,7 @@ {{name}} - {{currency amount}} + {{currency amount}} {{/each}}