xxx
parent
4f38511f3b
commit
98f644862a
|
@ -93,11 +93,13 @@ class ReportCycleItem(Model):
|
|||
ptypes[ptype['name'] or ""]=0
|
||||
for citem in get_model('clinic.cycle.item').search_browse(dom,order="date"):
|
||||
cycle=citem.cycle_id
|
||||
if cycle.id not in cycles.keys():
|
||||
cycles[cycle.id]=[]
|
||||
date=citem.date
|
||||
key='%s-%s'%(date,cycle.id)
|
||||
if key not in cycles.keys():
|
||||
cycles[key]=[]
|
||||
for line in citem.lines:
|
||||
nurse=line.nurse_id
|
||||
cycles[cycle.id].append({
|
||||
cycles[key].append({
|
||||
'name': nurse.name,
|
||||
'first_name': nurse.first_name or "",
|
||||
})
|
||||
|
@ -195,12 +197,13 @@ class ReportCycleItem(Model):
|
|||
total_fee+=line.get("fee",0)
|
||||
total_mdc+=line.get("mdc",0)
|
||||
cid=line['cid']
|
||||
if not cid in old:
|
||||
old.append(cid)
|
||||
if not key in old:
|
||||
old.append(key)
|
||||
index=0
|
||||
else:
|
||||
index+=1
|
||||
cres=cycles[cid]
|
||||
key='%s-%s'%(date,cid)
|
||||
cres=cycles[key]
|
||||
line['nurse']=''
|
||||
if index < len(cres):
|
||||
line['nurse']=cres[index]['name']
|
||||
|
@ -236,6 +239,8 @@ class ReportCycleItem(Model):
|
|||
'v%s_1'%index: vscl_line['qty'],
|
||||
})
|
||||
index+=1
|
||||
#for nline in nlines:
|
||||
#print(nline.get('date'), nline.get('nfirst_name'))
|
||||
data={
|
||||
'company_name': company_name or "",
|
||||
'lines': nlines,
|
||||
|
|
Loading…
Reference in New Issue