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 4dd358c..5977ec8 100644 --- a/netforce_clinic/layouts/clinic_report_account_hd_case_summary.xml +++ b/netforce_clinic/layouts/clinic_report_account_hd_case_summary.xml @@ -6,7 +6,8 @@ - + + diff --git a/netforce_clinic/models/report_account_hd_case_summary.py b/netforce_clinic/models/report_account_hd_case_summary.py index 0a2c9e2..5ded9b8 100644 --- a/netforce_clinic/models/report_account_hd_case_summary.py +++ b/netforce_clinic/models/report_account_hd_case_summary.py @@ -19,6 +19,7 @@ class ReportAccountHDCaseSummary(Model): 'reimbursable': fields.Selection([['yes','Yes'],['no','No']],'Claim'), 'walkin': fields.Selection([['yes','Yes'],['no','No']],'Walkin'), 'cycle_id': fields.Many2One("clinic.cycle","Cycle"), + 'pay_type': fields.Selection([['cash','Cash'],['credit','Credit']],'Pay Type'), 'product_id': fields.Many2One("product","Product"), } @@ -76,6 +77,7 @@ class ReportAccountHDCaseSummary(Model): walkin=defaults.get('walkin') ptype_id=None cycle_id=None + pay_type='' if ids: obj=self.browse(ids)[0] branch_id=obj.branch_id.id @@ -87,6 +89,7 @@ class ReportAccountHDCaseSummary(Model): cycle_id=obj.cycle_id.id reimbursable=obj.reimbursable or "" product_id=obj.product_id.id + pay_type=obj.pay_type walkin=obj.walkin dom=[ ['hd_case_id.date','>=', date_from], @@ -214,7 +217,20 @@ class ReportAccountHDCaseSummary(Model): else: records[hdcase_id]['misc']+=amt lines=[] + + # nurse would like to see only receipt + del_invoice=False + del_receipt=False + if pay_type and reimbursable=='no' and pay_type=='cash': + del_invoice=True + elif pay_type and reimbursable=='no' and pay_type=='credit': + del_receipt=True + for hdcase_id, vals in records.items(): + if del_invoice and vals['inv_number']: + continue + elif del_receipt and vals['pm_number']: + continue lines.append(vals) company_name=company.name or "" if department_id: diff --git a/netforce_clinic/models/shop.py b/netforce_clinic/models/shop.py index 028d799..9eabe06 100644 --- a/netforce_clinic/models/shop.py +++ b/netforce_clinic/models/shop.py @@ -892,6 +892,10 @@ class Shop(Model): for pick in shop.pickings: pick_id=pick.id pick_number=pick.number + st=get_model('clinic.setting').browse(1) + ct_ids=[] + for ct in st.product_categ_view: + ct_ids.append(ct.id) for line in shop.lines: prod=line.product_id categ=line.categ_id @@ -902,8 +906,10 @@ class Shop(Model): fee=0 dlz=0 mdc_names=[] - if categ.parent_id: - if categ.parent_id.code=='MDC': + #if categ.parent_id: + #if categ.parent_id.code=='MDC': #XXX + if categ: + if categ.id in ct_ids: mdc+=amount name=prod.name or "" name=name.split("-") @@ -940,7 +946,7 @@ class Shop(Model): 'fee': fee, 'mdc': mdc, 'mdc_name': ','.join([n for n in mdc_names]), - 'dlz_name': "", #XXX + 'dlz_name': "", 'dlz_id': "", 'dlz': dlz, 'lab': lab,