diff --git a/pos_customer_display/__manifest__.py b/pos_customer_display/__manifest__.py new file mode 100644 index 00000000000..f6ef4f65838 --- /dev/null +++ b/pos_customer_display/__manifest__.py @@ -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", + ], + } +} diff --git a/pos_customer_display/static/src/customer_display/customer_display.xml b/pos_customer_display/static/src/customer_display/customer_display.xml new file mode 100644 index 00000000000..cf0f69ddd2c --- /dev/null +++ b/pos_customer_display/static/src/customer_display/customer_display.xml @@ -0,0 +1,34 @@ + + + + + +
+ +
+
Customer
+
+ +
+
+
+
+ +
+ + / Guest +
+
+
+
+
+ +
+ +

Refund

+ +
+
+
+
+
diff --git a/pos_customer_display/static/src/customer_display/customer_display_adapter.js b/pos_customer_display/static/src/customer_display/customer_display_adapter.js new file mode 100644 index 00000000000..0a11122262c --- /dev/null +++ b/pos_customer_display/static/src/customer_display/customer_display_adapter.js @@ -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); + }, +});