diff --git a/netforce_clinic/layouts/clinic_cycle_form.xml b/netforce_clinic/layouts/clinic_cycle_form.xml index 725f602..30322be 100644 --- a/netforce_clinic/layouts/clinic_cycle_form.xml +++ b/netforce_clinic/layouts/clinic_cycle_form.xml @@ -12,8 +12,8 @@ - - - + + + diff --git a/netforce_clinic/layouts/clinic_make_apt.xml b/netforce_clinic/layouts/clinic_make_apt.xml index 7515862..f6a1c99 100644 --- a/netforce_clinic/layouts/clinic_make_apt.xml +++ b/netforce_clinic/layouts/clinic_make_apt.xml @@ -1,5 +1,5 @@ -
- + + diff --git a/netforce_clinic/layouts/clinic_menu.xml b/netforce_clinic/layouts/clinic_menu.xml index ff172e4..c21663e 100644 --- a/netforce_clinic/layouts/clinic_menu.xml +++ b/netforce_clinic/layouts/clinic_menu.xml @@ -39,7 +39,7 @@ - + diff --git a/netforce_clinic/models/visit_board.py b/netforce_clinic/models/visit_board.py index 355c7f7..1f5e26f 100644 --- a/netforce_clinic/models/visit_board.py +++ b/netforce_clinic/models/visit_board.py @@ -110,12 +110,16 @@ class VisitBoard(Model): patient_types={t['id']:t['name'] for t in get_model("clinic.patient.type").search_read([[]],['name'])} cycle_names={t['id']:t['name'] for t in get_model("clinic.cycle").search_read([[]],['name'])} + brch_names={t['id']:t['name'] for t in get_model("clinic.branch").search_read([[]],['name'])} + dpt_names={t['id']:t['name'] for t in get_model("clinic.department").search_read([[]],['name'])} total_wait=0 total_done=0 total_cancel=0 types={} cycles={} no=1 + dpt={} + brch={} for visit in get_model("clinic.visit").search_browse(dom): if visit.state in ('draft','pending'): total_wait+=1 @@ -137,7 +141,7 @@ class VisitBoard(Model): hd_case_id=hd_case.id, if hd_case.number=='/': - hd_case_number='*รอการรรักษา' + hd_case_number='*Waiting' else: hd_case_number=hd_case.number @@ -150,7 +154,7 @@ class VisitBoard(Model): number=visit.number if number=='/': - number='*รอการยืนยัน' + number='*Waiting' cycle=visit.cycle_id patient=visit.patient_id branch=visit.branch_id @@ -164,9 +168,11 @@ class VisitBoard(Model): if visit.state=='cancelled': visit_color='#dbdbdb', if visit.number=='/': - number='*(ยกเลิก)' + number='*(Cancelled)' else: - number+='(ยกเลิก)' + number+='(Cancelled)' + + line={ 'number': number, 'hn_name': hn_name, @@ -195,6 +201,8 @@ class VisitBoard(Model): 'details1':'', 'details2':'', 'details3':'', + 'details4':'', + 'details5':'', 'no': no, 'note': visit.note, 'hd_case_state':HD_STATE.get(hd_case_state,''), @@ -212,6 +220,18 @@ class VisitBoard(Model): [cycle_name.setdefault(cid,0) for cid in cycle_names.keys()] cycles[visit_date]=cycle_name cycles[visit_date][cycle.id]+=1 + + if not brch.get(visit_date): + brch_name={} + [brch_name.setdefault(cid,0) for cid in brch_names.keys()] + brch[visit_date]=brch_name + brch[visit_date][branch.id]+=1 + + if not dpt.get(visit_date): + dpt_name={} + [dpt_name.setdefault(cid,0) for cid in dpt_names.keys()] + dpt[visit_date]=dpt_name + dpt[visit_date][department.id]+=1 dates=[] index=0 @@ -236,11 +256,15 @@ class VisitBoard(Model): line=empty_line.copy() patient_str='%s'%', '.join('%s: %s'%(patient_types[k],v) for k,v in types[date].items()) cycle_str='%s'%', '.join('%s: %s'%(cycle_names[k],v) for k,v in cycles[date].items()) + brch_str='%s'%', '.join('%s: %s'%(brch_names[k],v) for k,v in brch[date].items()) + dpt_str='%s'%', '.join('%s: %s'%(dpt_names[k],v) for k,v in dpt[date].items()) summary_str='%s'%', '.join(['รับไว้: %s'%total_wait,'จำหน่ายแล้ว: %s'%total_done, 'ยกเลิก: %s'%total_cancel]) line['details']='ทั้งหมด %s: %s'%(total_qty,', '.join([summary_str,cycle_str,patient_str])) - line['details1']=summary_str - line['details2']=cycle_str - line['details3']=patient_str + line['details2']=summary_str + line['details3']=cycle_str + line['details1']=brch_str + line['details4']=dpt_str + line['details5']=patient_str line['footer']=True line['title']=False lines.insert(index,line) diff --git a/netforce_clinic/reports/visit_board.xlsx b/netforce_clinic/reports/visit_board.xlsx index 47b0b02..0769abf 100644 Binary files a/netforce_clinic/reports/visit_board.xlsx and b/netforce_clinic/reports/visit_board.xlsx differ diff --git a/netforce_clinic/templates/visit_board.hbs b/netforce_clinic/templates/visit_board.hbs index 74efa42..fa801c3 100644 --- a/netforce_clinic/templates/visit_board.hbs +++ b/netforce_clinic/templates/visit_board.hbs @@ -34,14 +34,20 @@ {{#each lines }} {{#if footer}} - สรุป - {{details1}} + สรุป + {{details1}} - {{details2}} + {{details2}} - {{details3}} + {{details3}} + + + {{details4}} + + + {{details5}} {{else}}