staff summary report

conv_bal
watcha.h@almacom.co.th 2015-01-19 23:11:57 +07:00
parent 32ed942983
commit 8397892443
7 changed files with 43 additions and 35 deletions

View File

@ -79,6 +79,7 @@
</field>
<field name="total_dcost" string="Total" span="3" offset="9"/>
</tab>
<!--
<tab string="Other Staff">
<field name="staff_lines" nolabel="1">
<list>
@ -102,6 +103,7 @@
</field>
<field name="total_stcost" string="Total" span="3" offset="9"/>
</tab>
-->
</tabs>
<foot>
<button string="Compute" icon="repeat" type="default" method="compute"/>

View File

@ -2,6 +2,6 @@
<field name="cycle_item_id"/>
<field name="total_dcost"/>
<field name="total_ncost"/>
<field name="total_stcost"/>
<!--<field name="total_stcost"/>-->
<field name="total"/>
</list>

View File

@ -13,7 +13,7 @@ class LaborCostEntryLine(Model):
'entry_id': fields.Many2One("clinic.labor.cost.entry","Entry",required=True),
'staff_id': fields.Many2One("clinic.staff","Staff",required=True),
'date': fields.Date("Date"),
'qty': fields.Integer("No.HD"),
'qty': fields.Integer("#HDCase"),
'rate': fields.Float("Rate Avg."),
'amount': fields.Float("Amount"),
'company_id': fields.Many2One("company","Company"),

View File

@ -12,7 +12,7 @@ class LaborCostLine(Model):
'staff_id': fields.Many2One("clinic.staff", "Staff",search=True),
'level_id': fields.Many2One("clinic.staff.level", "Level",search=True),
'cycle_id': fields.Many2One("clinic.cycle", "Cycle",search=True),
'qty': fields.Integer("Qty"),
'qty': fields.Integer("#HDCase"),
'rate': fields.Float("Rate",scale=2),
'amount': fields.Float("Amount",scale=2),
'date': fields.Date("Date",search=True),

View File

@ -84,28 +84,28 @@ class ReportStaffFeeDetail(Model):
cycle=item.cycle_id
branch=item.branch_id
dpt=item.department_id
for dt in lc.doctor_lines:
staff=dt.staff_id
lines.append({
items=[]
for dline in lc.doctor_lines:
staff=dline.staff_id
amount=dline.amount or 0
rate=dline.rate or 0
items.append({
'staff_id': staff.id,
'staff_name': staff.name or '',
'staff_type': staff.type or '',
'date': date,
'cycle_id': cycle.id,
'branch_id': branch.id,
'department_id': dpt.id,
'type': 'doctor',
'rate': rate,
'amount': amount,
})
for nr in lc.nurse_lines:
staff=dt.staff_id
lines.append({
for nline in lc.nurse_lines:
staff=nline.staff_id
rate=dline.rate or 0
items.append({
'staff_id': staff.id,
'staff_name': staff.name or '',
'staff_type': staff.type or '',
'date': date,
'cycle_id': cycle.id,
'branch_id': branch.id,
'department_id': dpt.id,
'type': 'nurse',
'rate': rate,
'amount': amount,
})
for item in items:
print(item)
month_str=utils.MONTHS['th_TH'][int(month)]
start=int(time_start[8:10])

View File

@ -54,8 +54,8 @@ class ReportStaffFeeSum(Model):
time_stop='%s-%s-%s'%(year,str(month).zfill(2),total_day)
staff_id=None
staff_type="nurse"
department_id=None
branch_id=None
department=None
branch=None
if ids:
obj=self.browse(ids)[0]
staff_type=obj.type
@ -63,8 +63,8 @@ class ReportStaffFeeSum(Model):
month=obj.date_from.split("-")[1]
time_start=obj.date_from
time_stop=obj.date_to
department_id=obj.department_id.id
branch_id=obj.branch_id.id
department=obj.department_id
branch=obj.branch_id
# generate list of date
fmt='%Y-%m-%d'
@ -85,10 +85,10 @@ class ReportStaffFeeSum(Model):
total_sum=0.0
dom=[]
dom.append(['type','=',staff_type])
if department_id:
dom.append(['department_id','=',department_id])
if branch_id:
dom.append(['branch_id','=',branch_id])
if department:
dom.append(['department_id','=',department.id])
if branch:
dom.append(['branch_id','=',branch.id])
for staff in get_model("clinic.staff").search_browse(dom):
if staff_id:
if staff_id!=staff.id:
@ -149,10 +149,16 @@ class ReportStaffFeeSum(Model):
'is_duration': diff+1 < total_day,
'year': year,
}
if obj.branch_id:
data['branch_name']='(%s)'%obj.branch_id.name or ''
if obj.department_id:
data['branch_name']='(%s)'%obj.department_id.name or ''
data['title']='สรุปค่าธรรมเนียมพยาบาล'
if staff_type=='doctor':
data['title']='สรุปค่าธรรมเนียมแพทย์'
elif staff_type=='staff':
data['title']='สรุปค่าธรรมเนียมเจ้าหน้าที่'
if branch:
data['branch_name']='(%s)'%branch.name or ''
if department:
data['branch_name']='(%s)'%department.name or ''
return data
def onchange_date(self,context={}):

View File

@ -1,5 +1,5 @@
<center>
<h2>สรุปค่าธรรมเนียมพยาบาล</h2>
<h2>{{title}}</h2>
<h3>
{{parent_company_name}}&nbsp;{{company_name}} {{branch_name}}<br/>
</h3>