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';