<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <data>
        <template id="l10n_in_pos.pos_order_receipt" inherit_id="point_of_sale.pos_order_receipt">
            <div name="before-footer" position="after">
                <div t-if="conditions.get('code_in') and extra_data['l10n_in_hsn_summary']['has_gst']">
                    <table class="l10n_in_hsn_summary_table pt-3 w-100">
                        <tr>
                            <th class="text-center fw-bolder" colspan="6">HSN Summary</th>
                        </tr>
                        <tr>
                            <th class="text-center">HSN Code</th>
                            <th class="text-center">Rate%</th>
                            <th class="text-center">CGST</th>
                            <th class="text-center">SGST</th>
                            <th class="text-center" t-if="extra_data['l10n_in_hsn_summary']['has_igst']">IGST</th>
                            <th class="text-center" t-if="extra_data['l10n_in_hsn_summary']['has_cess']">CESS</th>
                        </tr>
                        <tr t-foreach="extra_data['l10n_in_hsn_summary']['items']" t-as="item">
                            <td class="text-center" t-out="item['l10n_in_hsn_code']"/>
                            <td class="text-center"><t t-out="item['rate']"/> %</td>
                            <td class="text-center" t-out="item['tax_amount_cgst']"/>
                            <td class="text-center" t-out="item['tax_amount_sgst']"/>
                            <td class="text-center" t-if="extra_data['l10n_in_hsn_summary']['has_igst']" t-out="item['tax_amount_igst']"/>
                            <td class="text-center" t-if="extra_data['l10n_in_hsn_summary']['has_cess']" t-out="item['tax_amount_cess']"/>
                        </tr>
                    </table>
                </div>
            </div>
        </template>
        <template id="l10n_in_pos.pos_order_receipt_header" inherit_id="point_of_sale.pos_order_receipt_header">
            <span name="ticket" position="after">
                <span t-if="conditions.get('code_in') and not order['to_invoice']">
                    INVOICE
                </span>
                <span t-elif="conditions.get('code_in') and order['to_invoice']">
                    Tax Invoice
                </span>
            </span>
            <span name="ticket" position="attributes">
                <attribute name="t-if">not conditions.get('code_in')</attribute>
            </span>
        </template>
        <template id="l10n_in_pos.pos_orderline_receipt_information" inherit_id="point_of_sale.pos_orderline_receipt_information">
            <div name="extra-info">
                <t t-if="conditions.get('code_in')">
                        <div class="ps-2" t-if="line['l10n_in_hsn_code']">
                            <span>HSN Code: </span><t t-out="line['l10n_in_hsn_code']"/>
                        </div>
                    </t>
            </div>
        </template>
    </data>
</odoo>
