main treatment & share report claim

conv_bal
watcha.h 2015-03-20 18:16:17 +07:00
parent 5b8712f1a2
commit 7fb1f55947
7 changed files with 34 additions and 9 deletions

View File

@ -0,0 +1,8 @@
<action>
<field name="string">Report Claim/No Claim</field>
<field name="view_cls">report</field>
<field name="model">clinic.report.account.hd.case.summary</field>
<field name="report_template">report_account_hd_case_summary</field>
<field name="report_template_xls">report_account_hd_case_summary</field>
<field name="menu">clinic_menu</field>
</action>

View File

@ -46,6 +46,7 @@
<item string="Sickbed" action="clinic_sickbed"/>
</item>
<item string="Reporting" perm="clinic_report">
<item string="Report Claim/No Claim" action="clinic_report_claim"/>
<item string="Cycle Item Summary" action="clinic_report_cycle_item"/>
<item string="HD Case Summary" action="clinic_report_hd_case_summary"/>
<!--<item string="HD Case Summary(PDF)" action="clinic_hd_case_print"/>-->

View File

@ -15,7 +15,6 @@
<field name="last_name" required="1"/>
<field name="doctor_id"/>
<field name="walkin"/>
<field name="department_id" invisible="1"/>
<field name="active" invisible="1"/>
<tabs>
<tab string="General">
@ -80,13 +79,25 @@
<group span="4" columns="1">
</group>
</tab>
<tab string="Location">
<field name="departments"/>
<tab string="Department">
<field name="department_id" string="Main Department"/>
<group span="8" columns="1">
<template>
<div>
<p></p>
<b>Note: </b><span style="color:green"><b style="color:#3477b0">"Location"</b> คือ สถานที่ที่ผู้ป่วยสามารถรับการรักษา ซึ่งระบุได้มากกว่า 1 ที่</span></div>
<b>Note: </b><span style="color:green"><b style="color:#3477b0">"Main Department"</b> คือ สถานที่ี่ที่ผู้ป่วยรักษาประจำ</span></div>
</template>
</group>
<group span="4" columns="1">
</group>
</tab>
<tab string="HD Departments">
<field name="departments" nolabel="1"/>
<group span="8" columns="1">
<template>
<div>
<p></p>
<b>Note: </b><span style="color:green"><b style="color:#3477b0">"HD Departments"</b> คือ สถานที่ที่ผู้ป่วยสามารถรับการรักษา ซึ่งระบุได้มากกว่า 1 ที่</span></div>
</template>
</group>
<group span="4" columns="1">

View File

@ -11,7 +11,8 @@
<field name="name"/>
<field name="type_id"/>
<field name="walkin"/>
<field name="department_names"/>
<!--<field name="department_names"/>-->
<field name="department_id"/>
<field name="doctor_id"/>
<field name="dispose"/>
<!--<field name="image" preview='1'/>-->

View File

@ -6,4 +6,5 @@
<field name="department_id" domain='[["branch_id","=",branch_id]]' span="3"/>
<field name="ptype_id" span="2"/>
<field name="reimbursable" span="2"/>
<field name="cycle_id" span="2"/>
</form>

View File

@ -35,8 +35,8 @@
<field name="active"/>
</group>
</tab>
<tab string="Location">
<field name="departments"/>
<tab string="Departments">
<field name="departments" nolabel="1"/>
</tab>
<tab string="Professional Information">
<field name="prof_license" attrs='{"invisible":[["type","in",["staff"]]]}'/>

View File

@ -4,7 +4,6 @@ from calendar import monthrange
from netforce.model import Model, fields, get_model
from netforce.access import get_active_company
class ReportAccountHDCaseSummary(Model):
_name="clinic.report.account.hd.case.summary"
_string="HD Case Report Summary"
@ -18,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'),
'cycle_id': fields.Many2One("clinic.cycle","Cycle"),
}
def default_get(self,field_names=None,context={},**kw):
@ -59,6 +59,7 @@ class ReportAccountHDCaseSummary(Model):
department_id=defaults.get("department_id")
ptype_id=None
reimbursable=''
cycle_id=None
if ids:
obj=self.browse(ids)[0]
branch_id=obj.branch_id.id
@ -68,6 +69,7 @@ class ReportAccountHDCaseSummary(Model):
date_to=obj.date_to
ptype_id=obj.ptype_id.id
reimbursable=obj.reimbursable
cycle_id=obj.cycle_id.id
dom=[
['date','>=', date_from],
['date','<=', date_to],
@ -79,13 +81,14 @@ class ReportAccountHDCaseSummary(Model):
dom.append(['branch_id','=',branch_id])
if department_id:
dom.append(['department_id','=',department_id])
if cycle_id:
dom.append(['cycle_id','=',cycle_id])
if reimbursable=='yes':
dom.append(['state','in',['waiting_payment']])
elif reimbursable=='no':
dom.append(['state','in',['paid']])
else:
dom.append(['state','in',['completed','waiting_payment','paid']])
print('dom ', dom)
lines=[]
cycles={}
for hdcase in get_model("clinic.hd.case").search_browse(dom):