diff --git a/pos_customer_display/__manifest__.py b/pos_customer_display/__manifest__.py new file mode 100644 index 00000000000..5ee21c715be --- /dev/null +++ b/pos_customer_display/__manifest__.py @@ -0,0 +1,21 @@ +{ + "name": "POS Customer Display", + "version": "1.0", + "category": "Point of Sale", + "description": """ + Enhances the POS Customer Display by showing customer names, order details, + payment and refund information in a structured format. + """, + "author": "Khushi", + "depends": ["point_of_sale"], + "installable": True, + "assets": { + 'point_of_sale.assets_prod': [ + 'pos_customer_display/static/src/pos_order.js', + ], + 'point_of_sale.customer_display_assets': [ + 'pos_customer_display/static/src/customer_display/*', + ], + }, + "license": "LGPL-3", +} 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..b013687d084 --- /dev/null +++ b/pos_customer_display/static/src/customer_display/customer_display.xml @@ -0,0 +1,26 @@ + + + + +
+
+
Customer
+
+
+
+ +
Amount
+
/ Guest + +
+
+ + + + +
Refund
+ +
+
+ + diff --git a/pos_customer_display/static/src/pos_order.js b/pos_customer_display/static/src/pos_order.js new file mode 100644 index 00000000000..28aa25cd4d2 --- /dev/null +++ b/pos_customer_display/static/src/pos_order.js @@ -0,0 +1,21 @@ +/** @odoo-module **/ + +import { patch } from "@web/core/utils/patch"; +import { PosOrder } from "@point_of_sale/app/models/pos_order"; + +patch(PosOrder.prototype, { + getCustomerDisplayData() { + const lines = this.getSortedOrderlines(); + const refundLines = lines.filter((l) => l.refunded_orderline_id); + const nonRefundLines = lines.filter((l) => !l.refunded_orderline_id); + + return { + ...super.getCustomerDisplayData(), + + partnerName: this.get_partner_name() ? this.get_partner_name() : "Guest", + amount_per_guest: this.amountPerGuest, + refundLines: refundLines.map((l) => l.getDisplayData()), + lines: nonRefundLines.map((l) => l.getDisplayData()), + }; + }, +});