report staff fee

conv_bal
watcha.h@almacom.co.th 2015-01-19 21:26:16 +07:00
parent 93fbd6c64b
commit 54738bce05
3 changed files with 21 additions and 8 deletions

View File

@ -73,10 +73,10 @@ class ReportStaffFeeDetail(Model):
if staff_type: if staff_type:
dom.append(['staff_id.type','=',staff_type]) dom.append(['staff_id.type','=',staff_type])
staff_name='' staff_name=''
show_qty=False
if staff_id: if staff_id:
staff=get_model("clinic.staff").browse(staff_id) dom.append(['staff_id','=',staff_id])
staff_name=staff.name show_qty=True
dom.append(['staff_id','=',staff.id])
dlines=get_model('clinic.labor.cost.line').search_browse(dom) dlines=get_model('clinic.labor.cost.line').search_browse(dom)
# group by date # group by date
all_vals={} all_vals={}
@ -123,6 +123,11 @@ class ReportStaffFeeDetail(Model):
start=int(time_start[8:10]) start=int(time_start[8:10])
stop=int(time_stop[8:10]) stop=int(time_stop[8:10])
diff=stop-start diff=stop-start
branch_name=''
if branch:
branch_name='(%s)'%branch.name or ''
if department:
branch_name='(%s)'%department.name or ''
data={ data={
'company_name': company.name or "", 'company_name': company.name or "",
'parent_company_name': company.parent_id.name or "", 'parent_company_name': company.parent_id.name or "",
@ -135,6 +140,8 @@ class ReportStaffFeeDetail(Model):
'to': time_stop, 'to': time_stop,
'is_duration': diff+1 < total_day, 'is_duration': diff+1 < total_day,
'year': year, 'year': year,
'branch_name': branch_name,
'show_qty': show_qty,
} }
return data return data

View File

@ -1,7 +1,7 @@
<center> <center>
<h2>ผลตอบแทนดูแลผู้ป่วย</h2> <h2>ผลตอบแทนดูแลผู้ป่วย</h2>
<h3> <h3>
{{parent_company_name}}&nbsp;{{company_name}}<br/> {{parent_company_name}}&nbsp;{{company_name}}{{branch_name}}<br/>
</h3> </h3>
<h4> <h4>
{{staff_name}} {{staff_name}}
@ -51,9 +51,15 @@
{{/unless}} {{/unless}}
<th></th> <th></th>
<th></th> <th></th>
<th></th> {{#if show_qty}}
<th style="text-align:right">รวม</th> <th style="text-align:right">รวม</th>
<th style="text-align:right">{{currency total_amount}}</th> <th style="text-align:right">{{total_qty}}</th>
<th style="text-align:right">{{currency total_amount}}</th>
{{else}}
<th></th>
<th style="text-align:right">รวม</th>
<th style="text-align:right">{{currency total_amount}}</th>
{{/if}}
</tfoot> </tfoot>
</table> </table>
{{else}} {{else}}

View File

@ -1,5 +1,5 @@
<center> <center>
<h2>ผลตอบแทนดูแลผู้ป่วย</h2> <h2>รายละเอียดผลตอบแทนดูแลผู้ป่วย</h2>
<h3> <h3>
{{parent_company_name}}&nbsp;{{company_name}}<br/> {{parent_company_name}}&nbsp;{{company_name}}<br/>
</h3> </h3>