From fd1048903c541928e93c45938daece14f190a540 Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Tue, 3 Feb 2015 12:09:30 +0700 Subject: [PATCH] report staff --- netforce_clinic/models/labor_cost_entry.py | 3 ++- netforce_clinic/models/report_staff.py | 27 +++++++++++++++++---- netforce_clinic/reports/report_staff.xlsx | Bin 6690 -> 6956 bytes 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/netforce_clinic/models/labor_cost_entry.py b/netforce_clinic/models/labor_cost_entry.py index 5ac11c5..f8fb063 100644 --- a/netforce_clinic/models/labor_cost_entry.py +++ b/netforce_clinic/models/labor_cost_entry.py @@ -142,6 +142,7 @@ class LaborCostEntry(Model): for hd_case in item.hd_cases: #hids.update({hd_case.id}) pids.update({hd_case.patient_id.id}) + #print('pids ', pids) else: for hd_case in item.hd_cases: doctor_id=hd_case.doctor_id.id @@ -156,6 +157,7 @@ class LaborCostEntry(Model): })) plines=[] + print('pids ', list(pids)) for pid in list(pids): plines.append(('create',{ 'patient_id': pid, @@ -183,7 +185,6 @@ class LaborCostEntry(Model): for line in obj.lines: line.delete() - print('lines ', lines) obj.write({ 'lines': lines, }) diff --git a/netforce_clinic/models/report_staff.py b/netforce_clinic/models/report_staff.py index 3641dae..b9a7e9a 100644 --- a/netforce_clinic/models/report_staff.py +++ b/netforce_clinic/models/report_staff.py @@ -7,9 +7,10 @@ class ReportStaff(Model): def _get_store(self,ids,context={}): res={} for obj in self.browse(ids): - total=len(obj.lines) + htotal=len(obj.lines) + ptotal=len(obj.patients) res[obj.id]={ - 'name': total, + 'name': htotal or ptotal, } return res @@ -50,20 +51,36 @@ class ReportStaff(Model): refer_id=int(context.get("refer_id","0")) obj=get_model('clinic.report.staff').browse(refer_id) lines=[] - count=0 + count=1 for line in obj.lines: patient=line.patient_id hd_case=line.hd_case_id + amount=line.amount or 0 lines.append({ 'no': count, + 'date': line.date, + 'hd_case_name': hd_case.number, + 'patient_name': patient.name or '', + 'amount': amount + }) + count+=1 + count=1 + patients=[] + for pt in obj.patients: + patient=pt.patient_id + amount=pt.amount or 0 + patients.append({ + 'no': count, + 'patient_name': patient.name or '', + 'amount': amount, }) count+=1 data={ 'date_from': obj.date_from, 'date_to': obj.date_to, 'staff_name': obj.staff_id.name or '', - 'staff_type': obj.staff_type or '', - 'lines': lines, + 'lines': lines, # is doctor + 'patients': patients, } return data diff --git a/netforce_clinic/reports/report_staff.xlsx b/netforce_clinic/reports/report_staff.xlsx index 0b4265a88e436eb17ca919c6a810d64f79adc9a9..85089eccaade7bc8ad470e16c3362de5d2a203d7 100644 GIT binary patch delta 4316 zcmeI0_cz?x8^`r741*a4i9UqrHH3+hD62>BMDI~z62oQ;5-dh1qh%O^C?VPe(R+=O zA&6)}lte`TN_Nkl?Eduq1NQUF^Ld|h@AEnLp8J08^ZFD>m&wu_=#Y{DiKwWkh}MK| zR?)K(lU~Fc0b+rlFKB%dc?30|C}Z^cGhhZ(uLvsMu2(f#Ra8BBD`5QFR86uG0eFc{ zVS22hmU|m-y0X3PG3e8#7$vZ}R0wdjr%CDC3^?0AI$5T69irup(j--Aq3oW&h8a9? z^R*^l0F#T0t)?Cf60Qbnkk|TYO-EeOkF8_H)CH$Ebp4*VYfxU(i*S?f_sFNy2fTlW zh>dh9p^ZcSa74^X$rac6)@v|M$k^8nRV(TeUNX}ILZ8P7WL02xZ1lew)85`s!qb$8sV+s?ChxUfqAA|p zFa18A#E(ZH0KvsVRS9DpoSeB3eTJ~jS4bzw`TEED~ocp6p4>9NOcxRgFcZt1|8NkT?+G4UB$ zNz$&vxw3>57f-KCR42s^p$~jkYuui40WfH0D=SvaWQpY_1hm^@3YC^gnFe!|Xf2I!p%6HRvKL z>utM*E2GW7cufm>Hz5)`uNml2Qr%M%zRXHWL=;6qMD!2;T-b#VAt4s(?KPO87f6t0 zL~Wn4K)3=tI(>}-_*}eZd=!_ax%%DjhCS-Q#z;_$Ul!^-+wY{*FnT5#Kb~O9$>&)0 zVAq}vS)UR9JNJ%Xtn&oTC0-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