pos_custom_receipt/static/src/xml/receipt_overrides.xml

85 lines
3.7 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<!-- Hide Tracking Number from Receipt Header -->
<t t-name="pos_custom_receipt.ReceiptHeader" t-inherit="point_of_sale.ReceiptHeader" t-inherit-mode="extension">
<xpath expr="//div[span[hasclass('tracking-number')]]" position="replace">
<!-- Tracking number is hidden -->
</xpath>
<!-- Replace "Ticket" with "NO" -->
<xpath expr="//span[hasclass('ticket-name-prefix')]" position="replace">
<span class="ticket-name-prefix">
<t t-if="order.config._IS_VAT"> VAT </t>
NO
</span>
</xpath>
</t>
<!-- Hide Address, Phone, Email, and Powered By from Receipt Footer -->
<t t-name="pos_custom_receipt.OrderReceipt" t-inherit="point_of_sale.OrderReceipt" t-inherit-mode="extension">
<!-- Remove padding and margin from main receipt container (keep left padding default) -->
<xpath expr="//div[hasclass('pos-receipt')]" position="attributes">
<attribute name="class">pos-receipt pt-0 pe-0 pb-0 ps-2 m-0</attribute>
</xpath>
<!-- Hide header on basic receipt -->
<xpath expr="//ReceiptHeader" position="attributes">
<attribute name="t-if">!props.basic_receipt</attribute>
</xpath>
<!-- Show order note on basic receipt -->
<xpath expr="//li[@t-if='line.customerNote']" position="replace">
<li t-if="line.customer_note || line.customerNote" class="customer-note w-100 p-2 my-1 rounded text-break">
<i class="fa fa-sticky-note me-1" role="img" aria-label="Customer Note" title="Customer Note"/>
<t t-esc="line.customer_note || line.customerNote" />
</li>
</xpath>
<!-- Hide Address (Branch Address) -->
<xpath expr="//div[hasclass('w-50', 'text-start')]/div[2]" position="replace">
<!-- Branch address is hidden -->
</xpath>
<!-- Replace 'Pro forma receipt' text -->
<xpath expr="//div[contains(text(), 'Pro forma receipt')]" position="replace">
<div t-if="!order.finalized and !props.basic_receipt" class="fs-2 mb-1">!!! INI ADALAH TAGIHAN SEMENTARA, BUKAN BUKTI PEMBAYARAN !!!</div>
</xpath>
<!-- Change 'Tel:' to 'Contact:' -->
<xpath expr="//div[@t-if='company.phone']" position="replace">
<div t-if="company.phone">
Contact: <t t-out="company.phone"/>
</div>
</xpath>
<!-- Hide Email -->
<xpath expr="//div[@t-if='company.email']" position="replace">
<!-- Email is hidden -->
</xpath>
<!-- Hide 'Powered by Odoo' text -->
<xpath expr="//div[span[contains(text(), 'Powered by')]]" position="replace">
<!-- Powered by Odoo is hidden -->
</xpath>
<!-- Hide footer components on basic receipt -->
<xpath expr="//div[@t-if='order.config.receipt_footer']" position="attributes">
<attribute name="t-if">!props.basic_receipt and order.config.receipt_footer</attribute>
</xpath>
<xpath expr="//div[hasclass('after-footer')]" position="attributes">
<attribute name="t-if">!props.basic_receipt</attribute>
</xpath>
<xpath expr="//t[@t-if='order.shipping_date']" position="attributes">
<attribute name="t-if">!props.basic_receipt and order.shipping_date</attribute>
</xpath>
<xpath expr="//div[hasclass('d-flex', 'gap-2', 'pt-3')][div[hasclass('w-50')]]" position="attributes">
<attribute name="t-if">!props.basic_receipt</attribute>
</xpath>
</t>
</templates>