Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions pos_customer_display/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "POS Customer Display",
"version": "1.0",
"author": "Ravij Parikh (snrav)",
"description": "Display customer name, amount/guest and refund in POS",
"depends": ["point_of_sale"],
"application": True,
"license": "LGPL-3",
"assets": {
"point_of_sale.assets_prod": [
"pos_customer_display/static/src/customer_display/customer_display_adapter.js",
],
"point_of_sale.customer_display_assets": [
"pos_customer_display/static/src/customer_display/customer_display.xml",
],
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>

<templates id="template" xml:space="preserve">
<t t-inherit="point_of_sale.CustomerDisplay" t-inherit-mode="extension">
<xpath expr="//div[hasclass('o_customer_display_main')]//div[@t-if='order.change']" position="after">
<div>
<t t-if="order.partner_id">
<div class="row fs-2 fw-bolder">
<div class="col text-end">Customer </div>
<div class="col text-end">
<t t-esc="order.partner_id"/>
</div>
</div>
</t>
<div class="row fs-2 fw-bolder">
<t t-if="order.amountPerGuest">
<div class="message text-end">
<span t-esc="order.currency_symbol" style="margin-right:4px;"/>
<t t-esc="order.amountPerGuest.toFixed(2)" /> / Guest
</div>
</t>
</div>
</div>
</xpath>
<xpath expr="//div[hasclass('o_line_container')]" position="before">
<div>
<t t-if="order.is_refund">
<p class="p-2 fw-bolder">Refund</p>
<seperator />
</t>
</div>
</xpath>
</t>
</templates>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { patch } from "@web/core/utils/patch";
import { CustomerDisplayPosAdapter } from "@point_of_sale/app/customer_display/customer_display_adapter";

patch(CustomerDisplayPosAdapter.prototype, {
getCurrencySymbol(order) {
return order.currency?.symbol || "";
},

formatOrderData(order) {
super.formatOrderData(order);
this.data.partner_id = order.getPartnerName();
this.data.amountPerGuest = order.amountPerGuest();
this.data.is_refund = order.is_refund;
this.data.currency_symbol = this.getCurrencySymbol(order);
},
});