From 7fb1f55947d5f8f595ac3ddc2e8283b2d8b4e7b5 Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Fri, 20 Mar 2015 18:16:17 +0700 Subject: [PATCH] main treatment & share report claim --- .../actions/clinic_report_claim.xml | 8 ++++++++ netforce_clinic/layouts/clinic_menu.xml | 1 + .../layouts/clinic_patient_form.xml | 19 +++++++++++++++---- .../layouts/clinic_patient_list.xml | 3 ++- .../clinic_report_account_hd_case_summary.xml | 1 + netforce_clinic/layouts/clinic_staff_form.xml | 4 ++-- .../models/report_account_hd_case_summary.py | 7 +++++-- 7 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 netforce_clinic/actions/clinic_report_claim.xml diff --git a/netforce_clinic/actions/clinic_report_claim.xml b/netforce_clinic/actions/clinic_report_claim.xml new file mode 100644 index 0000000..d758ea4 --- /dev/null +++ b/netforce_clinic/actions/clinic_report_claim.xml @@ -0,0 +1,8 @@ + + Report Claim/No Claim + report + clinic.report.account.hd.case.summary + report_account_hd_case_summary + report_account_hd_case_summary + clinic_menu + diff --git a/netforce_clinic/layouts/clinic_menu.xml b/netforce_clinic/layouts/clinic_menu.xml index 17582ec..05e6bba 100644 --- a/netforce_clinic/layouts/clinic_menu.xml +++ b/netforce_clinic/layouts/clinic_menu.xml @@ -46,6 +46,7 @@ + diff --git a/netforce_clinic/layouts/clinic_patient_form.xml b/netforce_clinic/layouts/clinic_patient_form.xml index faf76f0..0dccd6d 100644 --- a/netforce_clinic/layouts/clinic_patient_form.xml +++ b/netforce_clinic/layouts/clinic_patient_form.xml @@ -15,7 +15,6 @@ - @@ -80,13 +79,25 @@ - - + + + + + + + + + + diff --git a/netforce_clinic/layouts/clinic_patient_list.xml b/netforce_clinic/layouts/clinic_patient_list.xml index e261242..1f7b48d 100644 --- a/netforce_clinic/layouts/clinic_patient_list.xml +++ b/netforce_clinic/layouts/clinic_patient_list.xml @@ -11,7 +11,8 @@ - + + diff --git a/netforce_clinic/layouts/clinic_report_account_hd_case_summary.xml b/netforce_clinic/layouts/clinic_report_account_hd_case_summary.xml index aa048fd..c7cef8c 100644 --- a/netforce_clinic/layouts/clinic_report_account_hd_case_summary.xml +++ b/netforce_clinic/layouts/clinic_report_account_hd_case_summary.xml @@ -6,4 +6,5 @@ + diff --git a/netforce_clinic/layouts/clinic_staff_form.xml b/netforce_clinic/layouts/clinic_staff_form.xml index 750c17b..090cbdb 100644 --- a/netforce_clinic/layouts/clinic_staff_form.xml +++ b/netforce_clinic/layouts/clinic_staff_form.xml @@ -35,8 +35,8 @@ - - + + diff --git a/netforce_clinic/models/report_account_hd_case_summary.py b/netforce_clinic/models/report_account_hd_case_summary.py index 53fec3a..a9c6f16 100644 --- a/netforce_clinic/models/report_account_hd_case_summary.py +++ b/netforce_clinic/models/report_account_hd_case_summary.py @@ -4,7 +4,6 @@ from calendar import monthrange from netforce.model import Model, fields, get_model from netforce.access import get_active_company - class ReportAccountHDCaseSummary(Model): _name="clinic.report.account.hd.case.summary" _string="HD Case Report Summary" @@ -18,6 +17,7 @@ class ReportAccountHDCaseSummary(Model): 'department_id': fields.Many2One("clinic.department","Departments"), 'ptype_id': fields.Many2One("clinic.patient.type","Patient Type"), 'reimbursable': fields.Selection([['yes','Yes'],['no','No']],'Claim'), + 'cycle_id': fields.Many2One("clinic.cycle","Cycle"), } def default_get(self,field_names=None,context={},**kw): @@ -59,6 +59,7 @@ class ReportAccountHDCaseSummary(Model): department_id=defaults.get("department_id") ptype_id=None reimbursable='' + cycle_id=None if ids: obj=self.browse(ids)[0] branch_id=obj.branch_id.id @@ -68,6 +69,7 @@ class ReportAccountHDCaseSummary(Model): date_to=obj.date_to ptype_id=obj.ptype_id.id reimbursable=obj.reimbursable + cycle_id=obj.cycle_id.id dom=[ ['date','>=', date_from], ['date','<=', date_to], @@ -79,13 +81,14 @@ class ReportAccountHDCaseSummary(Model): dom.append(['branch_id','=',branch_id]) if department_id: dom.append(['department_id','=',department_id]) + if cycle_id: + dom.append(['cycle_id','=',cycle_id]) if reimbursable=='yes': dom.append(['state','in',['waiting_payment']]) elif reimbursable=='no': dom.append(['state','in',['paid']]) else: dom.append(['state','in',['completed','waiting_payment','paid']]) - print('dom ', dom) lines=[] cycles={} for hdcase in get_model("clinic.hd.case").search_browse(dom):