<data priority="50">
    <t t-call="web.external_layout" position="replace">
        <t t-call="web.external_layout">
            <t t-set="address">
                <address t-field="o.employee_id.address_home_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;, &quot;phone&quot;], &quot;no_marker&quot;: True, &quot;phone_icons&quot;: True}"/>
            </t>
            <t t-set="input_lines" t-value="o.input_line_ids.filtered('name')"/>
            <div class="page">
                <style>
                    div.page {
                        font-size: 0.75rem;
                    }
                    h4 {
                        padding-top: 3rem;
                        padding-bottom: 1rem;
                    }
                </style>
                <h4 t-esc="o.name"/>
                <div class="row">
                    <div class="col-2">
                        <span>Datum</span>
                    </div>
                    <div class="col-3">
                        <span t-esc="context_timestamp(datetime.datetime.now()).strftime('%d.%m.%Y')"/>
                    </div>
                </div>
                <div class="row">
                    <div class="col-2">
                        <span>Periode</span>
                    </div>
                    <div class="col-3"><span t-field="o.date_from"/> - <span t-field="o.date_to"/>
                    </div>
                    <div class="col-2">
                        <span>Personalnr.</span>
                    </div>
                    <div class="col-3">
                        <span t-esc="o.employee_id.registration_number"/>
                    </div>
                    <div class="col-3">
                        <span>Geleistete Stunden</span>
                    </div>
                    <div class="col-4">
                        <span t-esc="o.gio_worked_hours"/>
                    </div>
                </div>
                <div class="row">
                    <div class="col-2">
                        <span>Sozialvers. Nr.</span>
                    </div>
                    <div class="col-3">
                        <span t-esc="o.employee_id.identification_id"/>
                    </div>
                </div>
                <table class="table td-no-top">
                    <style>
                        .table.td-no-top {
                        margin-top: 1rem;
                        }
                        .table.td-no-top td {
                        border-top: none;
                        padding-top: 0.25rem;
                        padding-bottom: 0.25rem;
                        }
                    </style>
                    <thead>
                        <tr>
                            <th>Lohnart</th>
                            <th>Ansatz</th>
                            <th class="text-right">
                                <span>Basis</span>
                            </th>
                            <th class="text-right">
                                <span>Betrag</span>
                            </th>
                        </tr>
                    </thead>
                    <!--<span t-esc="input_lines[0].input_type_id.code" />-->
                    <t t-foreach="o.line_ids" t-as="line">
                        <t t-set="inputs" t-value="input_lines.filtered(lambda i: i.input_type_id.code == line.code)"/>
                        <t t-if="line.salary_rule_id.appears_on_payslip and line.amount != 0.00">
                            <tr>
                                <!-- Lohnart -->
                                <td>
                                    <t t-if="line.code in ['5000'] or line.code in ['NET']">
                                        <span class="o_bold" t-field="line.name"/>
                                    </t>
                                    <t t-if="not line.code in ['5000'] and not line.code in ['NET']">
                                        <span t-field="line.name"/>
                                    </t>
                                    <t t-if="inputs">
                                        <br/>
                                        <i t-esc="inputs.name"/>
                                    </t>
                                </td>
                                <!-- Ansatz -->
                                <td>
                                    <t t-if="line.code in ['1000']">
                                        <span t-if="o.contract_id.gio_wage_hourly &gt; 0.0" t-field="o.contract_id.gio_wage_hourly"/>
                                    </t>
                                    <t t-if="line.code in ['5001']">
                                        <span t-esc="'%.2f' % (o.contract_id.gio_holiday_rate*100)"/>
                                        <span> %</span>
                                    </t>
                                    <t t-if="line.code in ['2176B']">
                                        <span t-esc="'%.2f' % o.contract_id.gio_name.gio_training_allowances"/>
                                    </t>
                                    <t t-if="line.code in ['2176A']">
                                        <span t-esc="'%.2f' % o.contract_id.gio_name.gio_child_allowances"/>
                                    </t>
                                    <t t-if="line.code in ['5010_A']">
                                        <span t-esc="'%.3f' % o.contract_id.gio_name.gio_ahv"/>
                                        <span> %</span>
                                    </t>
                                    <t t-if="line.code in ['5020_A']">
                                        <span t-field="o.contract_id.gio_name.gio_alv"/>
                                        <span> %</span>
                                    </t>
                                    <t t-if="line.code in ['5021_A']">
                                        <span t-field="o.contract_id.gio_name.gio_alv2"/>
                                        <span> %</span>
                                    </t>
                                    <t t-if="line.code in ['5030_A']">
                                        <span t-field="o.contract_id.gio_name.gio_nbu"/>
                                        <span> %</span>
                                    </t>
                                    <t t-if="line.code in ['5040_A']">
                                        <span t-field="o.contract_id.gio_name.gio_ktgf"/>
                                        <span> %</span>
                                    </t>
                                    <t t-if="line.code in ['5040_A2']">
                                        <span t-field="o.contract_id.gio_name.gio_ktgm"/>
                                        <span> %</span>
                                    </t>
                                    <t t-if="line.code in ['5031_A']">
                                        <span t-esc="'%.2f' % o.contract_id.gio_name.gio_uvg_supplementary_insurance"/>
                                    </t>
                                    <t t-if="line.code in ['5032_A']">
                                        <span t-esc="'%.2f' % o.contract_id.gio_name.gio_uvg_supplementary_insurance2"/>
                                    </t>
                                </td>
                                <!-- Basis -->
                                <td class="text-right">
                                    <t t-if="line.gio_amount">
                                        <span t-field="line.gio_amount"/>
                                    </t>
                                </td>
                                <!-- Betrag -->
                                <td class="text-right">
                                    <t t-if="line.code in ['5000', 'NET']">
                                        <span class="o_bold" t-field="line.amount"/>
                                    </t>
                                    <t t-if="not line.code in ['5000', 'NET']">
                                        <span t-field="line.amount"/>
                                    </t>
                                </td>
                            </tr>
                        </t>
                    </t>
                </table>
                <table class="table td-bottom-line">
                    <style>
                        .table.td-bottom-line {
                        padding-bottom: 3rem;
                        }
                        .table.td-bottom-line tr:nth-child(2n) td {
                        border-bottom: 2px solid #dee2e6;
                        }
                    </style>
                    <t t-foreach="o.line_ids" t-as="line">
                        <t t-if="line.category_id.code in ['NET']">
                            <tr>
                                <td>
                                    <span class="o_bold">Auszahlung</span>
                                </td>
                                <td class="text-right">
                                    <span class="o_bold" t-field="line.total"/>
                                </td>
                            </tr>
                        </t>
                    </t>
                </table>
                <p>Auszahlungsdetails:</p>
                <t t-foreach="o.line_ids" t-as="line">
                    <t t-if="line.category_id.code in ['NET']">
                        <p><span t-field="line.amount"/> &#xDC;berweisung an <span t-field="o.employee_id.bank_account_id.bank_id.name"/>, Konto <span t-field="o.employee_id.bank_account_id.acc_number"/>
                                <br/>
                            Beg&#xFC;nstigter: <span t-field="o.employee_id.name"/></p>
                    </t>
                </t>
            </div>
        </t>
    </t>
</data>
