fix report claim expense
parent
68cffef58b
commit
5b9bd61c46
|
@ -71,32 +71,30 @@ class ReportAccountHDCaseSummary(Model):
|
||||||
reimbursable=obj.reimbursable
|
reimbursable=obj.reimbursable
|
||||||
cycle_id=obj.cycle_id.id
|
cycle_id=obj.cycle_id.id
|
||||||
dom=[
|
dom=[
|
||||||
['date','>=', date_from],
|
['hd_case_id.date','>=', date_from],
|
||||||
['date','<=', date_to],
|
['hd_case_id.date','<=', date_to],
|
||||||
['patient_id.walkin','=','no'],
|
['hd_case_id.patient_id.walkin','=','no'],
|
||||||
]
|
]
|
||||||
if ptype_id:
|
if ptype_id:
|
||||||
dom.append(['patient_type_id','=',ptype_id])
|
dom.append(['hd_case_id.patient_type_id','=',ptype_id])
|
||||||
if branch_id:
|
if branch_id:
|
||||||
dom.append(['branch_id','=',branch_id])
|
dom.append(['hd_case_id.branch_id','=',branch_id])
|
||||||
if department_id:
|
if department_id:
|
||||||
dom.append(['department_id','=',department_id])
|
dom.append(['hd_case_id.department_id','=',department_id])
|
||||||
if cycle_id:
|
if cycle_id:
|
||||||
dom.append(['cycle_id','=',cycle_id])
|
dom.append(['hd_case_id.cycle_id','=',cycle_id])
|
||||||
if reimbursable=='yes':
|
if reimbursable:
|
||||||
dom.append(['state','in',['waiting_payment']])
|
dom.append(['reimbursable','=',reimbursable])
|
||||||
elif reimbursable=='no':
|
|
||||||
dom.append(['state','in',['paid']])
|
|
||||||
else:
|
else:
|
||||||
dom.append(['state','in',['completed','waiting_payment','paid']])
|
dom.append(['hd_case_id.state','in',['completed','waiting_payment','paid']])
|
||||||
lines=[]
|
lines=[]
|
||||||
cycles={}
|
cycles={}
|
||||||
for hdcase in get_model("clinic.hd.case").search_browse(dom):
|
for line in get_model("clinic.hd.case.line").search_browse(dom):
|
||||||
|
hdcase=line.hd_case_id
|
||||||
items={}
|
items={}
|
||||||
mdc_name=(hdcase.epo or "").split("-")
|
mdc_name=(hdcase.epo or "").split("-")
|
||||||
if mdc_name:
|
if mdc_name:
|
||||||
mdc_name=mdc_name[0].title()
|
mdc_name=mdc_name[0].title()
|
||||||
for line in hdcase.lines:
|
|
||||||
amt=line.amount or 0
|
amt=line.amount or 0
|
||||||
categ=line.product_categ_id
|
categ=line.product_categ_id
|
||||||
code=(categ.code or "").lower()
|
code=(categ.code or "").lower()
|
||||||
|
|
Loading…
Reference in New Issue