From 6d11f0e83a27b7c20680b44e4b7634e90ee3b067 Mon Sep 17 00:00:00 2001 From: Suherdy Yacob Date: Sun, 31 May 2026 22:36:05 +0700 Subject: [PATCH] feat: extend getOrderData to include order name, table details, and cashier information for kitchen printer receipts --- static/src/app/services/pos_store.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/static/src/app/services/pos_store.js b/static/src/app/services/pos_store.js index f0a2d30..cfd5c00 100644 --- a/static/src/app/services/pos_store.js +++ b/static/src/app/services/pos_store.js @@ -25,6 +25,14 @@ patch(PosStore.prototype, { return super.createPrinter(...arguments); }, + getOrderData(order, reprint) { + const data = super.getOrderData(...arguments); + data.name = order.getName(); + data.table_name = order.table_id ? (order.table_id.table_number ? "T " + order.table_id.table_number.toString() : order.table_id.name) : ""; + data.cashier = order.employee_id?.name || order.user_id?.name || ""; + return data; + }, + async printOrderChanges(data, printer) { if (printer.config && printer.config.printer_type === "network_escpos") { const changesData = data.changes?.data || []; @@ -38,7 +46,7 @@ patch(PosStore.prototype, { const receipt_data = { order_name: data.name || '', - order_time: data.time?.raw || new Date().toISOString(), + order_time: (typeof data.time === 'string' ? data.time : data.time?.raw) || new Date().toISOString(), waiter: data.cashier || '', table: data.table_name || '', lines: lines