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

    <t t-name="dine360_order_channels.OrderReceipt" t-inherit="point_of_sale.OrderReceipt" t-inherit-mode="extension" owl="1">
        <xpath expr="//div[hasclass('pos-receipt-order-data')]" position="before">
            <div class="channel-receipt-info mt-2 border-top pt-2">
                <div t-if="props.data.order_source" class="d-flex justify-content-between">
                    <span>Order Source:</span>
                    <span class="fw-bold text-uppercase" t-esc="props.data.order_source_label"/>
                </div>
                <div t-if="props.data.fulfilment_type" class="d-flex justify-content-between">
                    <span>Fulfilment:</span>
                    <span class="fw-bold text-uppercase" t-esc="props.data.fulfilment_type_label"/>
                </div>
                
                <t t-if="props.data.fulfilment_type === 'delivery'">
                    <div class="mt-2 pt-2 border-top">
                        <div class="fw-bold">DELIVERY ADDRESS:</div>
                        <div t-if="props.data.delivery_street" t-esc="props.data.delivery_street"/>
                        <div t-if="props.data.delivery_city || props.data.delivery_zip">
                            <t t-esc="props.data.delivery_city"/> <t t-esc="props.data.delivery_zip"/>
                        </div>
                        <div t-if="props.data.delivery_phone">Phone: <t t-esc="props.data.delivery_phone"/></div>
                        <div t-if="props.data.delivery_notes" class="mt-1 small italic">
                            Note: <t t-esc="props.data.delivery_notes"/>
                        </div>
                    </div>
                </t>
                
                <div t-if="props.data.social_ref" class="mt-1 small">
                    Ref: <t t-esc="props.data.social_ref"/>
                </div>
                <div t-if="props.data.whatsapp_number" class="mt-1 small">
                    WhatsApp: <t t-esc="props.data.whatsapp_number"/>
                </div>
            </div>
        </xpath>
    </t>

</templates>
