From 70781ab75e17d209fc84d464ef9bb4cf201d232a Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Tue, 13 Jan 2026 22:38:33 -0800 Subject: [PATCH] Show Takeaway/Delivery instead of Table name in KDS - Updated listForKDS.cfm to include OrderTypeName in response - Added getLocationLabel/getLocationValue helpers in kds.js - Takeaway orders now show "Type: Takeaway" - Delivery orders now show "Type: Delivery" - Dine-in orders continue to show "Table: [name]" Co-Authored-By: Claude Opus 4.5 --- api/orders/listForKDS.cfm | 10 ++++++++++ kds/kds.js | 25 ++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/api/orders/listForKDS.cfm b/api/orders/listForKDS.cfm index f3bc1f4..cbc6ac8 100644 --- a/api/orders/listForKDS.cfm +++ b/api/orders/listForKDS.cfm @@ -179,12 +179,22 @@ })> + + + + + + + + +
-
Table: ${order.ServicePointName || 'N/A'}
+
${getLocationLabel(order)}: ${getLocationValue(order)}
Customer: ${order.UserFirstName || ''} ${order.UserLastName || ''}
Status: ${STATUS_NAMES[order.OrderStatusID] || 'Unknown'}
@@ -409,6 +409,29 @@ async function updateOrderStatus(orderId, newStatusId) { } // Helper functions + +// Get location label based on order type (Table vs Type) +function getLocationLabel(order) { + // OrderTypeID: 1=Dine-In, 2=Takeaway, 3=Delivery + if (order.OrderTypeID === 2 || order.OrderTypeID === 3) { + return 'Type'; + } + return 'Table'; +} + +// Get location value based on order type +function getLocationValue(order) { + // OrderTypeID: 1=Dine-In, 2=Takeaway, 3=Delivery + if (order.OrderTypeID === 2) { + return 'Takeaway'; + } + if (order.OrderTypeID === 3) { + return 'Delivery'; + } + // Dine-in: show service point name + return order.ServicePointName || 'N/A'; +} + function getStatusClass(statusId) { switch (statusId) { case STATUS.NEW: return 'new';