<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="report_payslip">
    <t t-call="report.html_container">
        <t t-foreach="docs" t-as="o">
            <t t-call="report.external_layout">
                <div class="page">
                    <h2>Pay Slip</h2>
                    <p t-field="o.name"/>

                    <table class="table table-condensed table-bordered">
                        <tr>
                            <td><strong>Name</strong></td>
                            <td><span t-field="o.employee_id"/></td>
                            <td><strong>Designation</strong></td>
                            <td><span t-field="o.employee_id.job_id"/></td>
                        </tr>
                        <tr>
                            <td><strong>Address</strong></td>
                            <td colspan="3">
                                <div t-field="o.employee_id.address_home_id"
                                    t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
                            </td>
                        </tr>
                        <tr>
                            <td><strong>Email</strong></td>
                            <td><span t-field="o.employee_id.work_email"/></td>
                            <td><strong>Identification No</strong></td>
                            <td><span t-field="o.employee_id.job_id"/></td>
                        </tr>
                        <tr>
                            <td><strong>Reference</strong></td>
                            <td><span t-field="o.number"/></td>
                            <td><strong>Bank Account</strong></td>
                            <td><span t-field="o.employee_id.otherid"/></td>
                        </tr>
                        <tr>
                            <td><strong>Date From</strong></td>
                            <td><span t-field="o.date_from"/></td>
                            <td><strong>Date To</strong></td>
                            <td><span t-field="o.date_to"/></td>
                        </tr>
                    </table>

                    <table class="table table-condensed">
                        <thead>
                            <tr>
                                <th>Code</th>
                                <th>Name</th>
                                <th>Quantity/rate</th>
                                <th>Amount</th>
                                <th>Total</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr t-foreach="get_payslip_lines(o.line_ids)" t-as="p">
                                <td><span t-field="p.code"/></td>
                                <td><span t-field="p.name"/></td>
                                <td><span t-field="p.quantity"/></td>
                                <td><span t-esc="formatLang(p.amount, currency_obj=o.company_id.currency_id)"/></td>
                                <td><span t-esc="formatLang(p.total, currency_obj=o.company_id.currency_id)"/></td>
                            </tr>
                        </tbody>
                    </table>

                    <p class="text-right"><strong>Authorized signature</strong></p>
                </div>
            </t>
        </t>
    </t>
</template>
</data>
</openerp>
