feat: display kitchen and customer notes on basic receipts for line items and orders

This commit is contained in:
Suherdy Yacob 2026-06-03 09:45:44 +07:00
parent 2224b0c26f
commit 7e8fb46164

View File

@ -68,12 +68,32 @@
<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> <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 customer note and kitchen note (internal note) ONLY on basic receipt -->
<xpath expr="//li[@t-if='line.customerNote']" position="replace"> <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"> <t t-if="props.basic_receipt">
<i class="fa fa-sticky-note me-1" role="img" aria-label="Customer Note" title="Customer Note"/> <li t-if="line.customer_note || line.customerNote" class="customer-note w-100 p-2 my-1 rounded text-break">
<t t-esc="line.customer_note || line.customerNote" /> <i class="fa fa-sticky-note me-1" role="img" aria-label="Customer Note" title="Customer Note"/>
</li> <t t-esc="line.customer_note || line.customerNote" />
</li>
<t t-set="parsedInternalNotes" t-value="env.services.pos ? env.services.pos.getStrNotes(line.note || '[]') : (typeof line.note === 'string' ? line.note : '')" />
<li t-if="parsedInternalNotes" class="internal-note w-100 p-2 my-1 rounded text-break" style="background-color: #f8f9fa; border-left: 3px solid #6c757d;">
<i class="fa fa-cutlery me-1" role="img" aria-label="Kitchen Note" title="Kitchen Note"/>
<t t-esc="parsedInternalNotes" />
</li>
</t>
</xpath>
<!-- Show order-level internal and customer notes ONLY on basic receipt -->
<xpath expr="//OrderDisplay" position="after">
<t t-if="props.basic_receipt">
<t t-set="orderInternalNote" t-value="env.services.pos ? env.services.pos.getStrNotes(order.internal_note || '[]') : (typeof order.internal_note === 'string' ? order.internal_note : '')" />
<div t-if="orderInternalNote" class="order-internal-note p-2 my-2 rounded text-break" style="background-color: #f8f9fa; border-left: 3px solid #6c757d; font-size: 85%;">
<strong>Order Note: </strong><t t-esc="orderInternalNote" />
</div>
<div t-if="order.general_customer_note" class="order-customer-note p-2 my-2 rounded text-break" style="background-color: #fff3cd; border-left: 3px solid #ffc107; font-size: 85%;">
<strong>Customer Note: </strong><t t-esc="order.general_customer_note" />
</div>
</t>
</xpath> </xpath>
<!-- Hide Address (Branch Address) --> <!-- Hide Address (Branch Address) -->