diff --git a/netforce_clinic/models/report_medical_summary.py b/netforce_clinic/models/report_medical_summary.py index a11bd63..66bfd0e 100644 --- a/netforce_clinic/models/report_medical_summary.py +++ b/netforce_clinic/models/report_medical_summary.py @@ -93,6 +93,9 @@ class ReportMedicalSummary(Model): if ct_ids: dom.append(['categ_id.id','in',ct_ids]) categ_ids=set() + themself_id=0 + for type_id in get_model("clinic.patient.type").search([['code','=','CASH']]): + themself_id=type_id for prod in get_model("product").search_browse(dom): prod_code=prod.code or "" categ=prod.categ_id @@ -128,7 +131,10 @@ class ReportMedicalSummary(Model): continue if categ and categ.id not in list(categ_ids): continue - products[prod_code][patient_type_id]['qty']+=line.qty + if themself_id and patient_type_id!=themself_id and line.reimbursable=='no': + products[prod_code][themself_id]['qty']+=line.qty + else: + products[prod_code][patient_type_id]['qty']+=line.qty lines=[] limit_char=25