xxx
commit
bc73ddec5a
|
@ -4,6 +4,7 @@
|
|||
<field name="date_to" required="1" span="2"/>
|
||||
<field name="branch_id" onchange="onchange_branch" span="2"/>
|
||||
<field name="department_id" domain='[["branch_id","=",branch_id]]' span="2"/>
|
||||
<field name="cycle_id" span="2"/>
|
||||
<field name="report_type" span="2"/>
|
||||
<field name="show_detail" attrs='{"invisible":[["report_type","!=","detail"]]}'/>
|
||||
</form>
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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={}
|
||||
|
|
Loading…
Reference in New Issue