<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <template id="pos_hr.single_employee_sales_report" inherit_id="point_of_sale.pos_session_sales_details" primary="True">
        <xpath expr="//h2[@id='daily_report_title']" position="after">
            <t t-if="employee_name">
                <h5>Employee: <span t-out="employee_name">Abigal Peterson</span></h5>
            </t>
        </xpath>

        <xpath expr="//h2[@id='daily_report_title']" position="replace">
            <h2>Employee Sales Report</h2>
        </xpath>

        <xpath expr="//t[@id='closing_session']" position="replace"/>
    </template>

    <template id="pos_hr.report_salesdetails_with_employee_reports" inherit_id="point_of_sale.report_saledetails">
        <xpath expr="//t[@t-call='point_of_sale.pos_session_sales_details']" position="after">
                <t t-foreach="employee_ids" t-as="employee_id">
                    <t t-set="data" t-value="env['report.pos_hr.single_employee_sales_report'].get_sale_details(date_start, date_stop, config_ids, session_ids, employee_id)"/>
                    <t t-call="pos_hr.single_employee_sales_report"
                        opening_note="data['opening_note']"
                        closing_note="data['closing_note']"
                        state="data['state']"
                        currency="data['currency']"
                        nbr_orders="data['nbr_orders']"
                        session_name="data['session_name']"
                        employee_name="data['employee_name']"
                        config_names="data['config_names']"
                        payments="data['payments']"
                        company_name="data['company_name']"
                        taxes="data['taxes']"
                        taxes_info="data['taxes_info']"
                        products="data['products']"
                        products_info="data['products_info']"
                        refund_taxes="data['refund_taxes']"
                        refund_taxes_info="data['refund_taxes_info']"
                        refund_info="data['refund_info']"
                        refund_products="data['refund_products']"
                        discount_number="data['discount_number']"
                        discount_amount="data['discount_amount']"
                        invoiceList="data['invoiceList']"
                        invoiceTotal="data['invoiceTotal']"/>
                </t>
        </xpath>
    </template>
</odoo>
