report report

conv_bal
watcha.h@almacom.co.th 2015-01-15 23:26:44 +07:00
parent a7faddcfcd
commit 6e547eae65
3 changed files with 4 additions and 1 deletions

View File

@ -69,13 +69,14 @@ class ReportVisit(Model):
records=get_model('clinic.visit').search_browse(dom)
lines=[]
no=1
for record in records:
for record in sorted(records,key=lambda x: (x.patient_id.id,x.visit_date)):
lines.append({
'no': no,
'vid': record.id,
'cid': record.cycle_id.id,
'cname': record.cycle_id.name or "",
'pid': record.patient_id.id or '',
'hn': record.patient_id.hn_no or '',
'pname': record.patient_id.name or '',
'tname': record.patient_id.type_id.name or '',
'tid': record.patient_id.type_id.id or '',

View File

@ -18,6 +18,7 @@
<th>#</th>
<th>วันที่</th>
<th>รอบ</th>
<th>HN</th>
<th>ผู้ป่วย</th>
<th>สิทธ์</th>
<th>แพทย์</th>
@ -29,6 +30,7 @@
<td>{{no}}</td>
<td><a href="/ui#name=clinic_visit&active_id={{vid}}&mode=form">{{date}}</a></td>
<td><a href="/ui#name=clinic_cycle&active_id={{cid}}&mode=form">{{cname}}</a></td>
<td>{{hn}}</td>
<td><a href="/ui#name=clinic_patient&active_id={{pid}}&mode=form">{{pname}}</a></td>
<td><a href="/ui#name=clinic_patient&active_id={{tid}}&mode=form">{{tname}}</a></td>
<td><a href="/ui#name=clinic_staff&active_id={{did}}&mode=form">{{dname}}</a></td>