pos_closing_receipt/static/src/app/closing_receipt.xml

136 lines
6.1 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<!--
POS Closing Receipt Template
Rendered as an OWL component and printed via the browser print dialog
(printer service with webPrintFallback: true).
-->
<t t-name="pos_closing_receipt.ClosingReceipt">
<div class="pos-closing-receipt-print">
<div class="pos-receipt" style="font-family: 'Courier New', Courier, monospace; font-size: 25px; width: 100%; max-width: 320px; margin: 0 auto; padding: 12px;">
<!-- ===== HEADER ===== -->
<div style="text-align: center; margin-bottom: 10px;">
<div style="font-size: 33px; font-weight: bold; letter-spacing: 1px; text-transform: uppercase;">
<t t-esc="props.sessionName"/>
</div>
<div style="margin-top: 4px; font-size: 21px; letter-spacing: 2px;">
SESSION CLOSING SUMMARY
</div>
</div>
<div style="border-top: 1px dashed #000; margin: 8px 0;"/>
<!-- ===== CASHIER & DATETIME ===== -->
<table style="width: 100%; border-collapse: collapse; margin-bottom: 8px;">
<tr>
<td style="font-weight: bold; padding: 5px 0;">Cashier</td>
<td style="text-align: right; padding: 5px 0;">
<t t-esc="props.cashierName"/>
</td>
</tr>
<tr>
<td style="font-weight: bold; padding: 5px 0;">Date/Time</td>
<td style="text-align: right; padding: 5px 0; font-size: 21px;">
<t t-esc="props.closingTime"/>
</td>
</tr>
</table>
<div style="border-top: 1px dashed #000; margin: 8px 0;"/>
<!-- ===== PAYMENT METHODS ===== -->
<table style="width: 100%; border-collapse: collapse; margin-bottom: 8px;">
<!-- Cash -->
<t t-if="props.cashPayment">
<tr>
<td style="padding: 5px 0;">
<t t-esc="props.cashPayment.name"/>
</td>
<td style="text-align: right; padding: 5px 0;">
<t t-esc="props.cashPayment.formattedAmount"/>
</td>
</tr>
</t>
<!-- Non-cash methods -->
<t t-foreach="props.nonCashPayments" t-as="pm" t-key="pm.id">
<tr>
<td style="padding: 5px 0;">
<t t-esc="pm.name"/>
</td>
<td style="text-align: right; padding: 5px 0;">
<t t-esc="pm.formattedAmount"/>
</td>
</tr>
</t>
</table>
<div style="border-top: 1px solid #000; margin: 8px 0;"/>
<!-- ===== GRAND TOTAL ===== -->
<table style="width: 100%; border-collapse: collapse; margin-bottom: 8px;">
<tr>
<td style="font-weight: bold; font-size: 29px; padding: 6px 0;">TOTAL</td>
<td style="text-align: right; font-weight: bold; font-size: 29px; padding: 6px 0;">
<t t-esc="props.grandTotal"/>
</td>
</tr>
</table>
<!-- ===== CASH CONTROL DETAILS ===== -->
<t t-if="props.hasCashControl">
<div style="border-top: 1px dashed #000; margin: 8px 0;"/>
<table style="width: 100%; border-collapse: collapse; margin-bottom: 8px;">
<tr>
<td style="padding: 5px 0;">Expected Cash</td>
<td style="text-align: right; padding: 5px 0;">
<t t-esc="props.expectedCash"/>
</td>
</tr>
<tr>
<td style="padding: 5px 0;">Counted Cash</td>
<td style="text-align: right; padding: 5px 0;">
<t t-esc="props.countedCash"/>
</td>
</tr>
<tr>
<td style="font-weight: bold; padding: 5px 0;">Cash Difference</td>
<td style="text-align: right; font-weight: bold; padding: 5px 0;">
<t t-esc="props.cashDifference"/>
</td>
</tr>
</table>
</t>
<div style="border-top: 1px dashed #000; margin: 8px 0;"/>
<!-- ===== FOOTER ===== -->
<div style="text-align: center; margin-top: 12px; font-size: 21px; letter-spacing: 1px;">
*** Session Closed ***
</div>
<!-- Margin for paper feed -->
<div style="margin-top: 28px;">&#160;</div>
</div>
</div>
</t>
<!--
Extend the POS Navbar hamburger menu.
Adds "Reprint Closing Summary" as a DropdownItem inside pos-burger-menu-items.
Calls Navbar.reprintLastClosingReceipt() which fetches the last closed
session data from the server and prints using the ClosingReceipt component.
-->
<t t-name="pos_closing_receipt.NavbarPatch" t-inherit="point_of_sale.Navbar" t-inherit-mode="extension">
<xpath expr="//div[hasclass('pos-burger-menu-items')]" position="inside">
<DropdownItem onSelected="() => this.reprintLastClosingReceipt()">
<i class="fa fa-fw fa-print me-1"/>
Reprint Closing Summary
</DropdownItem>
</xpath>
</t>
</templates>