if no reimburse medical stock should set to CASH

stable
watcha.h 2016-02-19 08:58:32 +07:00
parent 765a9884ed
commit 464470f2af
1 changed files with 7 additions and 1 deletions

View File

@ -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,6 +131,9 @@ class ReportMedicalSummary(Model):
continue
if categ and categ.id not in list(categ_ids):
continue
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=[]