diff --git a/netforce_clinic/layouts/clinic_report_labor_cost.xml b/netforce_clinic/layouts/clinic_report_labor_cost.xml
index b8555fa..0c2dc49 100644
--- a/netforce_clinic/layouts/clinic_report_labor_cost.xml
+++ b/netforce_clinic/layouts/clinic_report_labor_cost.xml
@@ -4,6 +4,7 @@
+
diff --git a/netforce_clinic/models/hd_case.py b/netforce_clinic/models/hd_case.py
index de6cc7a..04d8fd1 100644
--- a/netforce_clinic/models/hd_case.py
+++ b/netforce_clinic/models/hd_case.py
@@ -134,7 +134,7 @@ class HDCase(Model):
elif categ.code=='DLZ':
dlz_price+=amt
elif categ.code=='SRV':
- dlz_price+=amt
+ srv+=amt
elif categ.code=="LAB":
if reimbursable_ctx:
if reimbursable_ctx==line.reimbursable:
diff --git a/netforce_clinic/models/report_labor_cost.py b/netforce_clinic/models/report_labor_cost.py
index e954e69..6e05c45 100644
--- a/netforce_clinic/models/report_labor_cost.py
+++ b/netforce_clinic/models/report_labor_cost.py
@@ -14,6 +14,7 @@ class ReportLaborCost(Model):
"date_from": fields.Date("From", required=True),
"date_to": fields.Date("To", required=True),
"branch_id": fields.Many2One("clinic.branch","Branch"),
+ "cycle_id": fields.Many2One("clinic.cycle","Cycle"),
"department_id": fields.Many2One("clinic.department","Department"),
'report_type': fields.Selection([['cross','Cross'],['detail','Detail']],'Type'),
'show_detail': fields.Boolean("Show Detail"),
@@ -51,6 +52,7 @@ class ReportLaborCost(Model):
date_to=defaults['date_to']
branch_id=defaults.get("branch_id")
department_id=defaults.get("department_id")
+ cycle_id=defaults.get("cycle_id")
show_detail=defaults['show_detail']
report_type=defaults['report_type']
dom=[]
@@ -62,6 +64,7 @@ class ReportLaborCost(Model):
department_id=obj.department_id.id
show_detail=obj.show_detail
report_type=obj.report_type
+ cycle_id=obj.cycle_id.id
dom.append(['date','>=',date_from])
dom.append(['date','<=',date_to])
dom.append(['cycle_item_id.state','=', 'validated'])
@@ -69,10 +72,13 @@ class ReportLaborCost(Model):
dom.append(['branch_id','=',branch_id])
if department_id:
dom.append(['department_id','=',department_id])
+ if cycle_id:
+ dom.append(['cycle_id','=',cycle_id])
date=date_from
hdcases={}
hdcase_obj=get_model("clinic.hd.case")
dstates=dict(hdcase_obj._fields['state'].selection)
+ print('dom ', dom)
for hdcase in hdcase_obj.search_browse(dom):
dpt=hdcase.department_id
state=hdcase.state or ''
@@ -149,6 +155,8 @@ class ReportLaborCost(Model):
dom.append(['labor_cost_id.cycle_item_id.branch_id','=',branch_id])
if department_id:
dom.append(['labor_cost_id.cycle_item_id.department_id','=',department_id])
+ if cycle_id:
+ dom.append(['labor_cost_id.cycle_item_id.cycle_id','=',cycle_id])
ddata={}
ndata={}
ctdata={}