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 <noreply@anthropic.com>
This commit is contained in:
parent
f919ef1cfe
commit
70781ab75e
2 changed files with 34 additions and 1 deletions
|
|
@ -179,12 +179,22 @@
|
||||||
})>
|
})>
|
||||||
</cfloop>
|
</cfloop>
|
||||||
|
|
||||||
|
<!--- Determine order type name --->
|
||||||
|
<cfset orderTypeName = "">
|
||||||
|
<cfswitch expression="#qOrders.OrderTypeID#">
|
||||||
|
<cfcase value="1"><cfset orderTypeName = "Dine-In"></cfcase>
|
||||||
|
<cfcase value="2"><cfset orderTypeName = "Takeaway"></cfcase>
|
||||||
|
<cfcase value="3"><cfset orderTypeName = "Delivery"></cfcase>
|
||||||
|
<cfdefaultcase><cfset orderTypeName = ""></cfdefaultcase>
|
||||||
|
</cfswitch>
|
||||||
|
|
||||||
<cfset arrayAppend(orders, {
|
<cfset arrayAppend(orders, {
|
||||||
"OrderID": qOrders.OrderID,
|
"OrderID": qOrders.OrderID,
|
||||||
"OrderUUID": qOrders.OrderUUID,
|
"OrderUUID": qOrders.OrderUUID,
|
||||||
"OrderUserID": qOrders.OrderUserID,
|
"OrderUserID": qOrders.OrderUserID,
|
||||||
"OrderBusinessID": qOrders.OrderBusinessID,
|
"OrderBusinessID": qOrders.OrderBusinessID,
|
||||||
"OrderTypeID": qOrders.OrderTypeID,
|
"OrderTypeID": qOrders.OrderTypeID,
|
||||||
|
"OrderTypeName": orderTypeName,
|
||||||
"OrderStatusID": qOrders.OrderStatusID,
|
"OrderStatusID": qOrders.OrderStatusID,
|
||||||
"OrderServicePointID": qOrders.OrderServicePointID,
|
"OrderServicePointID": qOrders.OrderServicePointID,
|
||||||
"OrderRemarks": qOrders.OrderRemarks,
|
"OrderRemarks": qOrders.OrderRemarks,
|
||||||
|
|
|
||||||
25
kds/kds.js
25
kds/kds.js
|
|
@ -289,7 +289,7 @@ function renderOrder(order) {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="order-info">
|
<div class="order-info">
|
||||||
<div><strong>Table:</strong> ${order.ServicePointName || 'N/A'}</div>
|
<div><strong>${getLocationLabel(order)}:</strong> ${getLocationValue(order)}</div>
|
||||||
<div><strong>Customer:</strong> ${order.UserFirstName || ''} ${order.UserLastName || ''}</div>
|
<div><strong>Customer:</strong> ${order.UserFirstName || ''} ${order.UserLastName || ''}</div>
|
||||||
<div><strong>Status:</strong> ${STATUS_NAMES[order.OrderStatusID] || 'Unknown'}</div>
|
<div><strong>Status:</strong> ${STATUS_NAMES[order.OrderStatusID] || 'Unknown'}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -409,6 +409,29 @@ async function updateOrderStatus(orderId, newStatusId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Helper functions
|
// 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) {
|
function getStatusClass(statusId) {
|
||||||
switch (statusId) {
|
switch (statusId) {
|
||||||
case STATUS.NEW: return 'new';
|
case STATUS.NEW: return 'new';
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue