<center>
    <h2>ผลตอบแทนดูแลผู้ป่วย</h2>
    <h3>
        {{parent_company_name}}&nbsp;{{company_name}}{{branch_name}}<br/>
    </h3>
    <h4>
        {{staff_name}}
    </h4>
    <h4>
        {{#if is_duration}}
            ระหว่างวันที่ {{from}} ถึง {{to}}
        {{else}}
            ประจำเดือน {{month}} {{year}}
        {{/if}}
    </h4>
</center>
{{#if lines}}
<table class="table table-condensed table-striped">
    <thead>
        <th>วันที่</th>
        {{#unless ../staff_name}}
            <th>บุคลากร</th>
            <th>ประเภท</th>
        {{/unless}}
        <th style="text-align:right">ชั้น</th>
        <th style="text-align:right">สาขา</th>
        <th style="text-align:right">จำนวนคนไข้</th>
        <th style="text-align:right">จำนวนเงิน</th>
    </thead>
    <tbody>
        {{#each lines}}
            <tr>
                <td>{{date}}</td>
                {{#unless ../staff_name}}
                    <td>
                        {{view "link" string=staff_name action="clinic_staff" action_options="mode=form" active_id=staff_id}}
                    </td>
                    <td>{{staff_type}}</td>
                {{/unless}}
                <td style="text-align:right">{{department_name}}</td>
                <td style="text-align:right">{{branch_name}}</td>
                <td style="text-align:right">{{qty}}</td>
                <td style="text-align:right">{{currency amount}}</td>
            </tr>
        {{/each}}
    </tbody>
    <tfoot>
        {{#unless ../staff_name}}
            <th></th>
            <th></th>
        {{/unless}}
        <th></th>
        <th></th>
        {{#if show_qty}}
            <th style="text-align:right">รวม</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>
</table>
{{else}}
    No items to display.
{{/if}}