pos_closing_receipt/report/pos_closing_summary_report.xml

146 lines
7.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!-- ════════════════════════════════════════════════════════════════════
Paper format: 80mm thermal receipt
width = 80mm, no margins so content fills the full roll width.
════════════════════════════════════════════════════════════════════ -->
<record id="paperformat_pos_closing_receipt" model="report.paperformat">
<field name="name">POS Closing Receipt (80mm)</field>
<field name="default" eval="False"/>
<field name="format">custom</field>
<field name="page_width">80</field>
<field name="page_height">297</field>
<field name="orientation">Portrait</field>
<field name="margin_top">3</field>
<field name="margin_bottom">3</field>
<field name="margin_left">3</field>
<field name="margin_right">3</field>
<field name="header_line" eval="False"/>
<field name="header_spacing">3</field>
<field name="dpi">96</field>
</record>
<!-- ════════════════════════════════════════════════════════════════════
Report Action
════════════════════════════════════════════════════════════════════ -->
<record id="action_report_pos_closing_summary" model="ir.actions.report">
<field name="name">POS Closing Summary</field>
<field name="model">pos.session</field>
<field name="report_type">qweb-html</field>
<field name="report_name">pos_closing_receipt.report_pos_closing_summary</field>
<field name="report_file">pos_closing_receipt.report_pos_closing_summary</field>
<field name="paperformat_id" ref="paperformat_pos_closing_receipt"/>
<field name="binding_model_id" ref="point_of_sale.model_pos_session"/>
<field name="binding_type">report</field>
</record>
<!-- ════════════════════════════════════════════════════════════════════
QWeb Template
Uses the same visual layout as the POS-frontend closing receipt so
the paper output looks identical to what was auto-printed on close.
════════════════════════════════════════════════════════════════════ -->
<template id="report_pos_closing_summary">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="session">
<t t-set="data" t-value="session.get_closing_summary_data()"/>
<div style="font-family: 'Courier New', Courier, monospace;
font-size: 28px;
width: 100%;
max-width: 320px;
margin: 0 auto;
padding: 12px;
page-break-after: always;">
<!-- ===== HEADER ===== -->
<div style="text-align: center; margin-bottom: 10px;">
<div style="font-size: 36px; font-weight: bold;
letter-spacing: 1px; text-transform: uppercase;">
<t t-esc="data['session_name']"/>
</div>
<div style="margin-top: 4px; font-size: 24px; letter-spacing: 2px;">
SESSION CLOSING SUMMARY
</div>
<div style="margin-top: 2px; font-size: 22px; color: #666;">
(REPRINT)
</div>
</div>
<div style="border-top: 1px dashed #000; margin: 8px 0;"/>
<!-- ===== CASHIER &amp; 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="data['cashier_name']"/>
</td>
</tr>
<tr>
<td style="font-weight: bold; padding: 5px 0;">Date/Time</td>
<td style="text-align: right; padding: 5px 0; font-size: 24px;">
<t t-esc="data['closing_time']"/>
</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="data['cash_payment']">
<tr>
<td style="padding: 5px 0;">
<t t-esc="data['cash_payment']['name']"/>
</td>
<td style="text-align: right; padding: 5px 0;">
<t t-esc="data['cash_payment']['amount']"
t-options="{'widget': 'monetary', 'display_currency': session.currency_id}"/>
</td>
</tr>
</t>
<!-- Non-cash methods -->
<t t-foreach="data['non_cash_payments']" t-as="pm">
<tr>
<td style="padding: 5px 0;">
<t t-esc="pm['name']"/>
</td>
<td style="text-align: right; padding: 5px 0;">
<t t-esc="pm['amount']"
t-options="{'widget': 'monetary', 'display_currency': session.currency_id}"/>
</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: 32px; padding: 6px 0;">TOTAL</td>
<td style="text-align: right; font-weight: bold; font-size: 32px; padding: 6px 0;">
<t t-esc="data['grand_total']"
t-options="{'widget': 'monetary', 'display_currency': session.currency_id}"/>
</td>
</tr>
</table>
<div style="border-top: 1px dashed #000; margin: 8px 0;"/>
<!-- ===== FOOTER ===== -->
<div style="text-align: center; margin-top: 12px;
font-size: 24px; letter-spacing: 1px;">
*** Session Closed ***
</div>
<!-- Margin for paper feed -->
<div style="margin-top: 28px;">&#160;</div>
</div>
</t>
</t>
</template>
</odoo>