nurse would like to see only receipt so they have to select claim : "yes" and pay_type : "cash"

fix_acc
watcha.h 2015-08-21 16:00:45 +07:00
parent da2a445432
commit cb16c13565
3 changed files with 27 additions and 4 deletions

View File

@ -6,7 +6,8 @@
<field name="department_id" domain='[["branch_id","=",branch_id]]' span="3"/>
<field name="ptype_id" span="2"/>
<field name="walkin" span="2"/>
<field name="reimbursable" span="2"/>
<field name="cycle_id" span="2"/>
<field name="product_id" span="2"/>
<field name="reimbursable" span="2"/>
<field name="pay_type" attrs='{"invisible":[["reimbursable","=","yes"]]}' span="2"/>
</form>

View File

@ -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:

View File

@ -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,