feat: implement minimal header for basic receipts and update item filtering logic, plus update module author information

This commit is contained in:
Suherdy Yacob 2026-05-29 21:37:21 +07:00
parent 33c8e73003
commit 2c23e5818a

View File

@ -25,14 +25,37 @@
<attribute name="class">pos-receipt pt-0 pe-0 pb-0 ps-2 m-0</attribute> <attribute name="class">pos-receipt pt-0 pe-0 pb-0 ps-2 m-0</attribute>
</xpath> </xpath>
<!-- Hide header on basic receipt --> <!-- Render minimal header on basic receipt, or full ReceiptHeader otherwise -->
<xpath expr="//ReceiptHeader" position="attributes"> <xpath expr="//ReceiptHeader" position="replace">
<attribute name="t-if">!props.basic_receipt</attribute> <t t-if="props.basic_receipt">
<div class="text-center pt-3" style="font-size: 75%;">
<div class="pos-receipt-vat font-monospace">
Ticket <t t-out="order.pos_reference"/>
</div>
<div t-if="order.date_order" id="order-date" t-out="order.formatDateOrTime('date_order')"/>
</div>
<div class="d-flex flex-column align-items-center mb-3">
<div class="pos-receipt-contact">
<div t-if="order?.getCashierName()" class="cashier">
Served by: <t t-esc="order.getCashierName()" />
</div>
<t t-if="order.table_id or order.self_ordering_table_id">
<t t-set="table" t-value="order.table_id || order.self_ordering_table_id"/>
<div>
Table <t t-esc="table.table_number"/><t t-if="order.customer_count">, Guests: <t t-esc="order.customer_count"/></t>
</div>
</t>
</div>
</div>
</t>
<t t-else="">
<ReceiptHeader order="order"/>
</t>
</xpath> </xpath>
<!-- Hide reward/coupon lines on basic receipt --> <!-- Hide reward/coupon/discount lines on basic receipt -->
<xpath expr="//Orderline" position="attributes"> <xpath expr="//Orderline" position="attributes">
<attribute name="t-if">!props.basic_receipt || (!line.is_reward_line &amp;&amp; line.price_unit &gt;= 0)</attribute> <attribute name="t-if">!props.basic_receipt || (!line.is_reward_line &amp;&amp; line.price_unit &gt;= 0 &amp;&amp; line.qty &gt;= 0 &amp;&amp; line.displayPrice &gt;= 0)</attribute>
</xpath> </xpath>
<!-- Show order note on basic receipt --> <!-- Show order note on basic receipt -->
@ -49,7 +72,7 @@
</xpath> </xpath>
<!-- Replace 'Pro forma receipt' text --> <!-- Replace 'Pro forma receipt' text -->
<xpath expr="//div[contains(text(), 'Pro forma receipt')]" position="replace"> <xpath expr="//div[@t-if='!order.finalized' and hasclass('fs-2', 'mb-1')]" position="replace">
<div t-if="!order.finalized and !props.basic_receipt" class="fs-2 mb-1">!!! INI ADALAH TAGIHAN SEMENTARA, BUKAN BUKTI PEMBAYARAN !!!</div> <div t-if="!order.finalized and !props.basic_receipt" class="fs-2 mb-1">!!! INI ADALAH TAGIHAN SEMENTARA, BUKAN BUKTI PEMBAYARAN !!!</div>
</xpath> </xpath>