diff --git a/netforce_clinic/models/report_labor_cost_detail.py b/netforce_clinic/models/report_labor_cost_detail.py index dc04859..2102eb7 100644 --- a/netforce_clinic/models/report_labor_cost_detail.py +++ b/netforce_clinic/models/report_labor_cost_detail.py @@ -126,13 +126,22 @@ class ReportLaborCostDetail(Model): dates[date][dpt.name]['qty']+=qty lines=[] dpts=get_model("clinic.department").search_read([],['name']) + department_name="" + if department_id: + department_name=get_model("clinic.department").browse(department_id).name or "" # link to sub detail + show_count=0 for dpt in dpts: + show_link=True + if dpt['name']!=department_name and department_name!='': + show_link=False + show_count+=1 dpt.update({ 'staff_id': staff_id, 'staff_type': staff_type, 'date_from': date_from, 'date_to': date_to, + 'show_link': show_link, }) dpts=sorted(dpts, key=lambda b: b['name']) no=1 @@ -209,6 +218,7 @@ class ReportLaborCostDetail(Model): 'comp_span': comp_span, #qty, amt 'lines': lines, 'dpt_lines': dpt_lines, + 'show_all': show_count <=1 and True or False, } return data diff --git a/netforce_clinic/templates/report_labor_cost_detail.hbs b/netforce_clinic/templates/report_labor_cost_detail.hbs index 3895a5f..381e4a7 100644 --- a/netforce_clinic/templates/report_labor_cost_detail.hbs +++ b/netforce_clinic/templates/report_labor_cost_detail.hbs @@ -7,7 +7,11 @@