<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">

    <t t-name="pos_restaurant.PaymentScreenValidate" t-inherit="point_of_sale.PaymentScreenValidate" t-inherit-mode="extension">
        <xpath expr="//button[hasclass('validation-button') and hasclass('next')]" position="attributes">
            <attribute name="t-att-hidden">pos.config.set_tip_after_payment and !currentOrder.isPaid()</attribute>
        </xpath>

        <xpath expr="//button[hasclass('validation-button') and hasclass('next')]/span" position="replace">
            <t t-if="pos.config.set_tip_after_payment and currentOrder.isPaid()">
                <span class="back_text">Close Tab</span>
            </t>
            <t t-else="">$0</t>
        </xpath>
    </t>
    <t t-name="pos_restaurant.PaymentScreenBack" t-inherit="point_of_sale.PaymentScreenBack" t-inherit-mode="extension">
        <xpath expr="//button[hasclass('button') and hasclass('back')]/span[hasclass('back_text')]" position="replace">
            <t t-if="pos.config.set_tip_after_payment and currentOrder.isPaid()">
                <span class="back_text">Keep Open</span>
            </t>
            <t t-else="">$0</t>
        </xpath>
    </t>
    <t t-name="pos_restaurant.PaymentScreenDue" t-inherit="point_of_sale.PaymentScreenDue" t-inherit-mode="extension">
        <xpath expr="//section[hasclass('paymentlines-container')]" position="inside">
            <div t-if="currentOrder.getCustomerCount() > 1" t-attf-class="message text-center {{ui.isSmall ? 'fs-2' : 'fs-1'}}" >
                <PriceFormatter price="this.env.utils.formatCurrency(currentOrder.amountPerGuest())" /> / Guest
                <button class="btn rounded-lg p" t-on-click="clickTableGuests" style="background-color: #ced4da;">
                    <span class="text-black fs-4 fw-bolder" t-esc="currentOrder?.getCustomerCount() || 0"/>
                </button>
            </div>
        </xpath>
    </t>

</templates>
