<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <data>
        <template id="l10n_tw_edi_ecpay_pos.pos_order_receipt_style" inherit_id="point_of_sale.pos_order_receipt_style">
            <xpath expr="//style" position="inside">
                #pos-receipt .pos-receipt-ecpay-width {
                    width: 400px !important;
                }
                #pos-receipt .pos-receipt-ecpay-width .text-insane { font-size: 38px !important; line-height: 44px !important; }
                #pos-receipt .pos-receipt-ecpay-width .text-huge { font-size: 34px !important; line-height: 40px !important; }
                #pos-receipt .pos-receipt-ecpay-width .text-large { font-size: 26px !important; line-height: 32px !important; }
                #pos-receipt .pos-receipt-ecpay-width .text-normal { font-size: 22px !important; line-height: 28px !important; }
                #pos-receipt .pos-receipt-ecpay-width .text-small { font-size: 18px !important; line-height: 24px !important; }

                #pos-receipt .pos-receipt-ecpay-width .px-2 {
                    padding-left: 4px !important;
                    padding-right: 4px !important;
                }
                #pos-receipt .pos-receipt-ecpay-width .ps-1 { padding-left: 2px !important; }
                #pos-receipt .pos-receipt-ecpay-width .pe-1 { padding-right: 2px !important; }

                #pos-receipt .pos-receipt-ecpay-width td,
                #pos-receipt .pos-receipt-ecpay-width th {
                    white-space: normal;
                }
                #pos-receipt .pos-receipt-ecpay-width tbody[name="company_info"] tr,
                #pos-receipt .pos-receipt-ecpay-width tbody[name="company_info"] td.text-start {
                    display: block;
                    width: 100% !important;
                    text-align: left !important;
                }
                #pos-receipt .pos-receipt-ecpay-width tbody[name="company_info"] td.text-end {
                    display: block;
                    width: 100% !important;
                    text-align: right !important;
                }
                #pos-receipt .pos-receipt-ecpay-width tbody[name="company_info"] td {
                    padding-bottom: 4px !important;
                }
                #pos-receipt .pos-receipt-ecpay-width img {
                    max-width: 100% !important;
                    height: auto !important;
                }
                #pos-receipt .pos-receipt-ecpay-width img.ecpay-barcode {
                    max-width: none !important;
                    height: 78px !important;
                    width: 400px !important;
                }
                #pos-receipt .pos-receipt-ecpay-width img.ecpay-logo {
                    display: block;
                    margin-left: auto;
                    margin-right: auto;
                }
                #pos-receipt .pos-receipt-ecpay-width .invoice-qr-code {
                    width: 160px !important;
                    height: 160px !important;
                    display: block;
                    margin: 0;
                }
                #pos-receipt .pos-receipt-ecpay-width td.w-25 {
                    width: 40% !important;
                    vertical-align: top !important;
                    text-align: left !important;
                }
                #pos-receipt .pos-receipt-ecpay-width td.w-75 {
                    width: 60% !important;
                    vertical-align: top !important;
                }
            </xpath>
        </template>

        <template id="l10n_tw_edi_ecpay_pos.pos_order_receipt" inherit_id="point_of_sale.pos_order_receipt">
            <xpath expr="//html/div" position="attributes">
                <attribute name="t-att-class">{'pos-receipt-ecpay-width': config.get('is_ecpay_enabled') and extra_data.get('account_fiscal_country_code') == 'TW'}</attribute>
            </xpath>
        </template>

        <template id="l10n_tw_edi_ecpay_pos.pos_order_receipt_header" inherit_id="point_of_sale.pos_order_receipt_header">
            <xpath expr="//span[@t-out=&quot;extra_data['formated_date_order']&quot;]" position="replace">
                <t t-if="extra_data.get('isPrintEcpayInvoice') and not extra_data.get('ecpay_error')">
                    <span t-out="extra_data['iis_create_date']" />
                </t>
                <t t-else="">$0</t>
            </xpath>
        </template>

    </data>
</odoo>
