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 08511b8..4dd358c 100644 --- a/netforce_clinic/layouts/clinic_report_account_hd_case_summary.xml +++ b/netforce_clinic/layouts/clinic_report_account_hd_case_summary.xml @@ -5,6 +5,7 @@ + diff --git a/netforce_clinic/models/hd_case_staff.py b/netforce_clinic/models/hd_case_staff.py index 8bb24ca..9ebf33b 100644 --- a/netforce_clinic/models/hd_case_staff.py +++ b/netforce_clinic/models/hd_case_staff.py @@ -37,7 +37,7 @@ class HDCaseStaff(Model): _defaults={ 'type': 'doctor', - 'priop': 'second', + 'priop': 'owner', } HDCaseStaff.register() diff --git a/netforce_clinic/models/report_account_hd_case_summary.py b/netforce_clinic/models/report_account_hd_case_summary.py index 48731d7..5b9234f 100644 --- a/netforce_clinic/models/report_account_hd_case_summary.py +++ b/netforce_clinic/models/report_account_hd_case_summary.py @@ -17,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'), + 'walkin': fields.Selection([['yes','Yes'],['no','No']],'Walkin'), 'cycle_id': fields.Many2One("clinic.cycle","Cycle"), 'product_id': fields.Many2One("product","Product"), } @@ -72,6 +73,7 @@ class ReportAccountHDCaseSummary(Model): department_id=defaults.get("department_id") reimbursable=defaults.get('reimbursable','yes') product_id=defaults.get('product_id') + walkin=defaults.get('walkin') ptype_id=None cycle_id=None if ids: @@ -85,12 +87,14 @@ class ReportAccountHDCaseSummary(Model): cycle_id=obj.cycle_id.id reimbursable=obj.reimbursable or "" product_id=obj.product_id.id + walkin=obj.walkin dom=[ ['hd_case_id.date','>=', date_from], ['hd_case_id.date','<=', date_to], - ['hd_case_id.patient_id.walkin','=','no'], ['hd_case_id.state','in',['completed','waiting_payment','paid']], ] + if walkin: + dom.append(['hd_case_id.patient_id.walkin','=',walkin]) if ptype_id: dom.append(['hd_case_id.patient_type_id','=',ptype_id]) if branch_id: @@ -180,7 +184,7 @@ class ReportAccountHDCaseSummary(Model): 'mdc_name': hdcase.mdc_name, 'dlz_name': hdcase.dlz_name, 'dlz_id': hdcase.dlz_id and hdcase.dlz_id or 0, - 'dlz_price': hdcase.dlz_price or 1, + 'dlz_price': hdcase.dlz_price, 'lab': hdcase.lab, 'misc': hdcase.misc, 'inv_ref': inv_ref and inv_ref or "-", @@ -207,18 +211,16 @@ class ReportAccountHDCaseSummary(Model): lines=[] for hdnumber, vals in records.items(): lines.append(vals) - print("#1 ", len(lines)) #get data from rd shop - if reimbursable=='no': - ctx={ - 'date_from': date_from, - 'date_to': date_to, - 'branch_id': branch_id, - 'department_id': department_id, - } - shop_lines=get_model('clinic.shop').get_shop_data(context=ctx)['records'] - lines+=shop_lines - print("#2 ", len(lines)) + #if reimbursable=='no': + #ctx={ + #'date_from': date_from, + #'date_to': date_to, + #'branch_id': branch_id, + #'department_id': department_id, + #} + #shop_lines=get_model('clinic.shop').get_shop_data(context=ctx)['records'] + #lines+=shop_lines company_name=company.name or "" if department_id: company_name+=' (%s)'%get_model('clinic.department').browse(department_id).name or ""