From 8dff08140707b61b97e2b5907aac962791fa5b55 Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Fri, 30 Jan 2026 22:58:46 -0800 Subject: [PATCH] Fix remaining old column names missed by initial batch rename MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Second pass fixing 70+ references across 32 files: - Orders: DeliveryMultiplier→BusinessDeliveryMultiplier, OrderTipAmount→TipAmount, OrderPaymentCompletedOn→PaymentCompletedOn, OrderPaymentError→PaymentError - Orders PK: WHERE OrderID=? → WHERE ID=? on Orders table - OrderLineItems PK: OrderLineItemID→ID in INSERT, WHERE, and query results - Items: parent.ItemID→parent.ID in JOIN conditions - Tasks: t.TaskID→t.ID in JOIN conditions - Users PK: WHERE UserID=X → WHERE ID=X on Users table - Addresses PK: A.AddressID→A.ID in JOIN conditions - tt_States: tt_StateID→ID, remove nonexistent tt_StateCountryID/tt_StateSortOrder - tt_OrderTypes: tt_OrderTypeID→ID, tt_OrderTypeName→Name - tt_Days: D.tt_DayID→D.ID - confirm_email.cfm: Add missing SELECT/FROM to queries - setLineItem.cfm: Fix 13 old column references - Stripe webhook/payment: Fix column names and PK references Co-Authored-By: Claude Opus 4.5 --- api/addresses/states.cfm | 2 +- api/admin/setupBigDeansInfo.cfm | 4 +- api/beacons/lookup.cfm | 177 +++++++++++++---------------- api/businesses/update.cfm | 4 +- api/chat/getActiveChat.cfm | 2 +- api/menu/items.cfm | 34 ++++-- api/orders/abandonOrder.cfm | 4 +- api/orders/debugLineItems.cfm | 2 +- api/orders/getCart.cfm | 8 +- api/orders/getDetail.cfm | 4 +- api/orders/getOrCreateCart.cfm | 6 +- api/orders/listForKDS.cfm | 6 +- api/orders/setLineItem.cfm | 52 ++++----- api/orders/setOrderType.cfm | 12 +- api/orders/submit.cfm | 14 +-- api/orders/updateStatus.cfm | 4 +- api/setup/saveWizard.cfm | 4 +- api/stripe/createPaymentIntent.cfm | 2 +- api/stripe/webhook.cfm | 8 +- api/tasks/complete.cfm | 2 +- api/tasks/getDetails.cfm | 66 +++++------ api/tasks/listMine.cfm | 12 +- api/tasks/listPending.cfm | 8 +- api/tasks/listTypes.cfm | 4 +- api/workers/ledger.cfm | 3 +- api/workers/myBusinesses.cfm | 2 +- confirm.cfm | 2 +- confirm_email.cfm | 12 +- confirm_mobile.cfm | 8 +- index.cfm | 43 ++++--- receipt/index.cfm | 8 +- show_order.cfm | 4 +- 32 files changed, 259 insertions(+), 264 deletions(-) diff --git a/api/addresses/states.cfm b/api/addresses/states.cfm index 397d4c4..ed81780 100644 --- a/api/addresses/states.cfm +++ b/api/addresses/states.cfm @@ -6,7 +6,7 @@ try { qStates = queryExecute(" - SELECT tt_StateID as StateID, Abbreviation as StateAbbreviation, Name as StateName + SELECT ID as StateID, Abbreviation as StateAbbreviation, Name as StateName FROM tt_States ORDER BY Name ", {}, { datasource: "payfrit" }); diff --git a/api/admin/setupBigDeansInfo.cfm b/api/admin/setupBigDeansInfo.cfm index 854b1b0..0a277c0 100644 --- a/api/admin/setupBigDeansInfo.cfm +++ b/api/admin/setupBigDeansInfo.cfm @@ -13,8 +13,8 @@ try { // Hours: Mon-Thu: 11am-10pm, Fri-Sat: 11am-11pm, Sun: 11am-10pm // Get California StateID - qState = queryExecute("SELECT tt_StateID FROM tt_States WHERE Abbreviation = 'CA' LIMIT 1"); - stateId = qState.recordCount > 0 ? qState.tt_StateID : 5; // Default to 5 if not found + qState = queryExecute("SELECT ID FROM tt_States WHERE Abbreviation = 'CA' LIMIT 1"); + stateId = qState.recordCount > 0 ? qState.ID : 5; // Default to 5 if not found // Check if Big Dean's already has an address existingAddr = queryExecute(" diff --git a/api/beacons/lookup.cfm b/api/beacons/lookup.cfm index 3a41d7a..bf88327 100644 --- a/api/beacons/lookup.cfm +++ b/api/beacons/lookup.cfm @@ -2,112 +2,87 @@ - -/** - * Lookup beacons by UUID - * - * POST: { - * UUIDs: array of UUID strings (without dashes, uppercase) - * } - * - * Returns: { - * OK: true, - * BEACONS: [ - * { - * UUID: "...", - * BeaconID: int, - * Name: string, - * BusinessID: int, - * Name: string, - * ServicePointID: int, - * Name: string, - * ParentBusinessID: int (if applicable), - * ParentName: string (if applicable), - * HasChildren: boolean - * } - * ] - * } - */ + -response = { "OK": false }; + -try { - requestData = deserializeJSON(toString(getHttpRequestData().content)); + + #serializeJSON({ + "OK" = true, + "ERROR" = "", + "BEACONS" = [] + })# + + - uuids = requestData.UUIDs ?: []; + + + + + + + + - if (!isArray(uuids) || arrayLen(uuids) == 0) { - response["OK"] = true; - response["BEACONS"] = []; - writeOutput(serializeJSON(response)); - abort; - } + + #serializeJSON({ + "OK" = true, + "ERROR" = "", + "BEACONS" = [] + })# + + - // Clean and normalize UUIDs (remove dashes, uppercase) - cleanUUIDs = []; - for (uuid in uuids) { - cleanUUID = uCase(reReplace(uuid, "-", "", "all")); - if (len(cleanUUID) == 32) { - arrayAppend(cleanUUIDs, cleanUUID); - } - } + + + SELECT + b.ID AS BeaconID, + b.Name AS BeaconName, + b.UUID, + COALESCE(sp.ID, 0) AS ServicePointID, + COALESCE(sp.Name, '') AS ServicePointName, + COALESCE(sp.BusinessID, lt.BusinessID, b.BusinessID) AS BusinessID, + biz.Name AS BusinessName, + biz.ParentBusinessID, + COALESCE(parent.Name, '') AS ParentBusinessName, + (SELECT COUNT(*) FROM Businesses WHERE ParentBusinessID = biz.ID) AS ChildCount + FROM Beacons b + LEFT JOIN ServicePoints sp ON sp.BeaconID = b.ID + LEFT JOIN lt_BeaconsID_BusinessesID lt ON lt.BeaconID = b.ID + INNER JOIN Businesses biz ON COALESCE(sp.BusinessID, lt.BusinessID, b.BusinessID) = biz.ID + LEFT JOIN Businesses parent ON biz.ParentBusinessID = parent.ID + WHERE b.UUID IN () + AND b.IsActive = 1 + AND biz.IsDemo = 0 + AND biz.IsPrivate = 0 + - if (arrayLen(cleanUUIDs) == 0) { - response["OK"] = true; - response["BEACONS"] = []; - writeOutput(serializeJSON(response)); - abort; - } + + + + - // Query for matching beacons with business info - // Beacons resolve to businesses via: ServicePoints, join table, or owner - qBeacons = queryExecute(" - SELECT - b.ID, - b.Name, - b.UUID, - COALESCE(sp.ID, 0) AS ServicePointID, - COALESCE(sp.Name, '') AS Name, - COALESCE(sp.BusinessID, lt.BusinessID, b.BusinessID) AS BusinessID, - biz.Name, - biz.ParentBusinessID, - parent.Name AS ParentName, - (SELECT COUNT(*) FROM Businesses WHERE ParentBusinessID = biz.ID) AS ChildCount - FROM Beacons b - LEFT JOIN ServicePoints sp ON sp.BeaconID = b.ID - LEFT JOIN lt_BeaconsID_BusinessesID lt ON lt.BeaconID = b.ID - INNER JOIN Businesses biz ON COALESCE(sp.BusinessID, lt.BusinessID, b.BusinessID) = biz.ID - LEFT JOIN Businesses parent ON biz.ParentBusinessID = parent.ID - WHERE b.UUID IN (:uuids) - AND b.IsActive = 1 - AND biz.IsDemo = 0 - AND biz.IsPrivate = 0 - ", { - uuids: { value: arrayToList(cleanUUIDs), cfsqltype: "cf_sql_varchar", list: true } - }, { datasource: "payfrit" }); +#serializeJSON({ + "OK" = true, + "ERROR" = "", + "BEACONS" = beacons +})# - beacons = []; - for (row in qBeacons) { - arrayAppend(beacons, { - "UUID": row.UUID, - "BeaconID": row.ID, - "Name": row.Name, - "BusinessID": row.BusinessID, - "Name": row.Name, - "ServicePointID": row.ServicePointID, - "Name": row.Name, - "ParentBusinessID": val(row.ParentBusinessID), - "ParentName": row.ParentName ?: "", - "HasChildren": row.ChildCount > 0 - }); - } - - response["OK"] = true; - response["BEACONS"] = beacons; - -} catch (any e) { - response["ERROR"] = e.message; -} - -writeOutput(serializeJSON(response)); - + + #serializeJSON({ + "OK" = false, + "ERROR" = cfcatch.message + })# + + diff --git a/api/businesses/update.cfm b/api/businesses/update.cfm index e60a7d7..e3b1bf5 100644 --- a/api/businesses/update.cfm +++ b/api/businesses/update.cfm @@ -81,10 +81,10 @@ try { stateID = 0; if (len(state)) { qState = queryExecute(" - SELECT tt_StateID FROM tt_States WHERE Abbreviation = :abbr + SELECT ID FROM tt_States WHERE Abbreviation = :abbr ", { abbr: uCase(state) }, { datasource: "payfrit" }); if (qState.recordCount > 0) { - stateID = qState.tt_StateID; + stateID = qState.ID; } } diff --git a/api/chat/getActiveChat.cfm b/api/chat/getActiveChat.cfm index 54d2302..0e00ee1 100644 --- a/api/chat/getActiveChat.cfm +++ b/api/chat/getActiveChat.cfm @@ -66,7 +66,7 @@ try { apiAbort({ "OK": true, "HAS_ACTIVE_CHAT": true, - "TASK_ID": qChat.TaskID, + "TASK_ID": qChat.ID, "TASK_TITLE": qChat.Title }); } else { diff --git a/api/menu/items.cfm b/api/menu/items.cfm index a793a44..9746f3d 100644 --- a/api/menu/items.cfm +++ b/api/menu/items.cfm @@ -183,8 +183,8 @@ SELECT i.ID, i.CategoryID, - c.Name, - i.Name, + c.Name AS CategoryName, + i.Name AS ItemName, i.Description, i.ParentItemID, i.Price, @@ -195,8 +195,9 @@ i.IsCollapsible, i.SortOrder, i.StationID, - s.Name, - s.Color + s.Name AS StationName, + s.Color, + c.MenuID FROM Items i LEFT JOIN Categories c ON c.ID = i.CategoryID LEFT JOIN Stations s ON s.ID = i.StationID @@ -317,7 +318,6 @@ "ItemID": qCategories.ID, "CategoryID": qCategories.ID, "Name": qCategories.Name, - "Name": qCategories.Name, "Description": "", "ParentItemID": 0, "Price": 0, @@ -327,6 +327,7 @@ "MaxNumSelectionReq": 0, "IsCollapsible": 0, "SortOrder": qCategories.SortOrder, + "MenuID": isNull(qCategories.MenuID) ? 0 : val(qCategories.MenuID), "StationID": "", "ItemName": "", "ItemColor": "" @@ -360,11 +361,27 @@ + + + + + + + + + + + + + + + + + diff --git a/api/orders/abandonOrder.cfm b/api/orders/abandonOrder.cfm index 586a83a..5cb57b7 100644 --- a/api/orders/abandonOrder.cfm +++ b/api/orders/abandonOrder.cfm @@ -52,14 +52,14 @@ diff --git a/api/orders/debugLineItems.cfm b/api/orders/debugLineItems.cfm index 1529f7d..661f592 100644 --- a/api/orders/debugLineItems.cfm +++ b/api/orders/debugLineItems.cfm @@ -32,7 +32,7 @@ 0) @@ -155,7 +155,7 @@ parent.Name AS ItemParentName FROM OrderLineItems oli INNER JOIN Items i ON i.ID = oli.ItemID - LEFT JOIN Items parent ON parent.ItemID = i.ParentItemID + LEFT JOIN Items parent ON parent.ID = i.ParentItemID WHERE oli.OrderID = ? AND oli.IsDeleted = b'0' ORDER BY oli.ID @@ -165,7 +165,7 @@ - direct child: ItemID=#qKids.ItemID#")> + direct child: ItemID=#qKids.ID#")> - template child: ItemID=#qTemplateKids.ItemID#")> + template child: ItemID=#qTemplateKids.ID#")> @@ -103,7 +103,7 @@ " SELECT ID FROM OrderLineItems - WHERE OrderID = ? + WHERE ID = ? AND ParentOrderLineItemID = ? AND ItemID = ? LIMIT 1 @@ -121,18 +121,18 @@ " UPDATE OrderLineItems SET IsDeleted = b'0' - WHERE OrderLineItemID = ? + WHERE ID = ? ", - [ { value = qExisting.OrderLineItemID, cfsqltype = "cf_sql_integer" } ], + [ { value = qExisting.ID, cfsqltype = "cf_sql_integer" } ], { datasource = "payfrit" } )> - + - + @@ -375,7 +375,7 @@ " UPDATE OrderLineItems SET IsDeleted = b'1' - WHERE OrderID = ? + WHERE ID = ? AND ParentOrderLineItemID = ? AND ItemID != ? AND IsDeleted = b'0' @@ -395,13 +395,13 @@ - + @@ -446,29 +446,29 @@ - - + + - + - - + @@ -181,7 +181,7 @@ " SELECT COUNT(*) AS Cnt FROM OrderLineItems - WHERE OrderID = ? + WHERE ID = ? AND ParentOrderLineItemID = 0 AND IsDeleted = b'0' ", @@ -253,7 +253,7 @@ StatusID = 1, SubmittedOn = ?, LastEditedOn = ? - WHERE OrderID = ? + WHERE ID = ? ", [ { value = now(), cfsqltype = "cf_sql_timestamp" }, diff --git a/api/orders/updateStatus.cfm b/api/orders/updateStatus.cfm index bfde882..160686e 100644 --- a/api/orders/updateStatus.cfm +++ b/api/orders/updateStatus.cfm @@ -56,7 +56,7 @@ UPDATE Orders SET StatusID = ?, LastEditedOn = ? - WHERE OrderID = ? + WHERE ID = ? ", [ { value = NewStatusID, cfsqltype = "cf_sql_integer" }, { value = now(), cfsqltype = "cf_sql_timestamp" }, @@ -91,7 +91,7 @@ diff --git a/api/setup/saveWizard.cfm b/api/setup/saveWizard.cfm index 06a4040..1e55038 100644 --- a/api/setup/saveWizard.cfm +++ b/api/setup/saveWizard.cfm @@ -71,12 +71,12 @@ try { response.steps.append("State value received: '" & state & "' (len: " & len(state) & ")"); if (len(state)) { qState = queryExecute(" - SELECT tt_StateID FROM tt_States WHERE Abbreviation = :abbr + SELECT ID FROM tt_States WHERE Abbreviation = :abbr ", { abbr: uCase(state) }, { datasource: "payfrit" }); response.steps.append("State lookup for '" & uCase(state) & "' found " & qState.recordCount & " records"); if (qState.recordCount > 0) { - stateID = qState.tt_StateID; + stateID = qState.ID; response.steps.append("Using stateID: " & stateID); } } diff --git a/api/stripe/createPaymentIntent.cfm b/api/stripe/createPaymentIntent.cfm index 52ae950..75fc286 100644 --- a/api/stripe/createPaymentIntent.cfm +++ b/api/stripe/createPaymentIntent.cfm @@ -145,7 +145,7 @@ try { try { queryExecute(" UPDATE WorkPayoutLedgers wpl - INNER JOIN Tasks t ON t.TaskID = wpl.TaskID AND t.OrderID = :orderID + INNER JOIN Tasks t ON t.ID = wpl.TaskID AND t.OrderID = :orderID SET wpl.StripePaymentIntentID = :piID WHERE wpl.Status = 'pending_charge' AND wpl.StripePaymentIntentID IS NULL diff --git a/api/stripe/webhook.cfm b/api/stripe/webhook.cfm index 639e32d..732d2b8 100644 --- a/api/stripe/webhook.cfm +++ b/api/stripe/webhook.cfm @@ -53,9 +53,9 @@ try { queryExecute(" UPDATE Orders SET PaymentStatus = 'paid', - OrderPaymentCompletedOn = NOW(), + PaymentCompletedOn = NOW(), StatusID = CASE WHEN StatusID = 0 THEN 1 ELSE StatusID END - WHERE OrderID = :orderID + WHERE ID = :orderID ", { orderID: orderID }); writeLog(file="stripe_webhooks", text="Order #orderID# marked as paid"); @@ -141,8 +141,8 @@ try { queryExecute(" UPDATE Orders SET PaymentStatus = 'failed', - OrderPaymentError = :failureMessage - WHERE OrderID = :orderID + PaymentError = :failureMessage + WHERE ID = :orderID ", { orderID: orderID, failureMessage: failureMessage diff --git a/api/tasks/complete.cfm b/api/tasks/complete.cfm index 455d773..7184c70 100644 --- a/api/tasks/complete.cfm +++ b/api/tasks/complete.cfm @@ -115,7 +115,7 @@ UPDATE Orders SET StatusID = 5, LastEditedOn = NOW() - WHERE OrderID = ? + WHERE ID = ? ", [ { value = qTask.OrderID, cfsqltype = "cf_sql_integer" } ], { datasource = "payfrit" })> diff --git a/api/tasks/getDetails.cfm b/api/tasks/getDetails.cfm index 567d619..da4c488 100644 --- a/api/tasks/getDetails.cfm +++ b/api/tasks/getDetails.cfm @@ -37,26 +37,26 @@ - + @@ -95,20 +95,21 @@ @@ -132,7 +134,7 @@ LIMIT 1 ", [ { value = qTask.ServicePointID, cfsqltype = "cf_sql_integer" } ], { datasource = "payfrit" })> - + @@ -140,16 +142,16 @@ UPDATE Users SET IsEmailVerified = 1 - WHERE UserID = '#get_user.ID#' + WHERE ID = #get_user.ID# diff --git a/confirm_email.cfm b/confirm_email.cfm index 896421e..4345632 100644 --- a/confirm_email.cfm +++ b/confirm_email.cfm @@ -6,7 +6,8 @@ - ID AS UserID + SELECT ID AS UserID, EmailAddress + FROM Users WHERE UUID = '#url.UUID#' AND IsEmailVerified = 0 @@ -19,7 +20,7 @@ UPDATE Users SET IsEmailVerified = 1 - WHERE UserID = '#get_user.ID#' + WHERE ID = '#get_user.ID#' @@ -48,7 +49,8 @@ - ID AS UserID + SELECT ID AS UserID, ContactNumber + FROM Users WHERE UUID = '#url.UUID#' AND IsEmailVerified = 0 @@ -61,7 +63,7 @@ UPDATE Users SET IsEmailVerified = 1 - WHERE UserID = '#get_confirmed_customer.UserID#' + WHERE ID = '#get_confirmed_customer.UserID#' your email was confirmed but we still need to verify your mobile number!

@@ -71,7 +73,7 @@ UPDATE Users SET MobileVerifyCode = '#customer_OPT_confirm#' - WHERE UserID = #get_confirmed_customer.UserID# + WHERE ID = #get_confirmed_customer.UserID# we sent a six-digit code to #get_confirmed_customer.ContactNumber#, please input that code here:

diff --git a/confirm_mobile.cfm b/confirm_mobile.cfm index f675b84..2d0721b 100644 --- a/confirm_mobile.cfm +++ b/confirm_mobile.cfm @@ -22,7 +22,7 @@ UPDATE Users SET IsContactVerified = 1 - WHERE UserID = #check_valid.UserID# + WHERE ID = #check_valid.ID# @@ -58,14 +58,14 @@ UPDATE Users SET IsContactVerified = 1 - WHERE UserID = #check_valid_with_email_confirmed.UserID# + WHERE ID = #check_valid_with_email_confirmed.ID# - + @@ -73,7 +73,7 @@ diff --git a/index.cfm b/index.cfm index 34e6b37..c9aea47 100644 --- a/index.cfm +++ b/index.cfm @@ -21,7 +21,7 @@ UPDATE Orders SET StatusID = 2 - WHERE OrderID = #form.OrderID# + WHERE ID = #form.OrderID# @@ -45,7 +45,7 @@ UPDATE OrderLineItems SET StatusID = 2 - WHERE OrderID = #form.OrderLineItemID# + WHERE ID = #form.OrderLineItemID# @@ -68,7 +68,7 @@ UPDATE Orders SET StatusID = 3 - WHERE OrderID = #form.OrderID# + WHERE ID = #form.OrderID# @@ -92,7 +92,7 @@ UPDATE OrderLineItems SET StatusID = 3 - WHERE OrderLineItemID = #form.OrderLineItemID# + WHERE ID = #form.OrderLineItemID# @@ -626,10 +626,9 @@ - SELECT tt_StateID, Name + SELECT ID, Name FROM tt_States - WHERE tt_StateCountryID = 1 - ORDER BY tt_StateSortOrder + ORDER BY Name @@ -639,7 +638,7 @@ @@ -661,17 +660,16 @@ - SELECT tt_OrderTypeID, tt_OrderTypeName + SELECT ID, Name FROM tt_OrderTypes - WHERE tt_OrderTypeSortOrder IS NOT NULL - ORDER BY tt_OrderTypeSortOrder + ORDER BY ID Select Order Types: - CHECKED>#get_OrderTypes.tt_OrderTypeName#
+ CHECKED
>#get_OrderTypes.Name#
@@ -825,7 +823,7 @@ FROM Hours H, tt_Days D WHERE BusinessID = #request.BusinessID# AND - H.DayID = D.tt_DayID + H.DayID = D.ID ORDER BY DayID @@ -1197,7 +1195,7 @@ FROM Hours H, tt_Days D WHERE BusinessID = #request.BusinessID# AND - H.DayID = D.tt_DayID + H.DayID = D.ID ORDER BY DayID @@ -1238,7 +1236,7 @@ FROM Hours H, tt_Days D WHERE BusinessID = #request.BusinessID# AND - H.DayID = D.tt_DayID + H.DayID = D.ID ORDER BY DayID @@ -3436,10 +3434,9 @@ - SELECT tt_StateID, Name + SELECT ID, Name FROM tt_States - WHERE tt_StateCountryID = 1 - ORDER BY tt_StateSortOrder + ORDER BY Name @@ -3449,7 +3446,7 @@ @@ -3564,7 +3561,7 @@ UPDATE Users SET ImageExtension = '#cffile.ClientFileExt#' - WHERE UserID = #request.UserID# + WHERE ID = #request.UserID# @@ -3618,7 +3615,7 @@ UPDATE Users SET ImageExtension = null - WHERE UserID = #request.UserID# + WHERE ID = #request.UserID# @@ -3638,7 +3635,7 @@ UPDATE Users SET FirstName = '#values.FirstName#', LastName = '#values.LastName#' - WHERE UserID = #request.UserID# + WHERE ID = #request.UserID# @@ -3648,7 +3645,7 @@ City = '#values.City#', StateID = #values.StateID#, ZIPCode = '#values.ZIPCode#' - WHERE UserID = #request.UserID# + WHERE ID = #request.UserID# AND AddressTypeID = 1 diff --git a/receipt/index.cfm b/receipt/index.cfm index 8a99ffe..35972c5 100644 --- a/receipt/index.cfm +++ b/receipt/index.cfm @@ -43,9 +43,9 @@ - SELECT tt_OrderTypeName + SELECT Name AS tt_OrderTypeName FROM tt_OrderTypes - WHERE tt_OrderTypeID = + WHERE ID = @@ -53,7 +53,7 @@ SELECT A.Line1 FROM Addresses A, Orders O WHERE O.UUID = - AND A.AddressID = O.AddressID + AND A.ID = O.AddressID @@ -257,7 +257,7 @@ SELECT I.Name, I.Price, I.ParentItemID FROM OrderLineItems OL JOIN Items I ON I.ID = OL.ItemID - WHERE OL.ParentOrderLineItemID = + WHERE OL.ParentOrderLineItemID = ORDER BY OL.AddedOn DESC diff --git a/show_order.cfm b/show_order.cfm index c186ce4..1eecc5b 100644 --- a/show_order.cfm +++ b/show_order.cfm @@ -24,9 +24,9 @@ WHERE O.UUID = '#form.UUID#' AND O.ID = T.OrderID AND - A.AddressID = O.AddressID + A.ID = O.AddressID AND - ttO.tt_OrderTypeID = O.OrderTypeID + ttO.ID = O.OrderTypeID ORDER BY AddedOn DESC