From e1000dbe19f088cad2b248a180a1e6f25cf25404 Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Fri, 6 Feb 2026 18:28:36 -0800 Subject: [PATCH] Fix customer lookup: prioritize Order.UserID over Task.UserID For order-based tasks, the customer comes from Order.UserID. For standalone tasks without an order, fall back to Task.UserID. Co-Authored-By: Claude Opus 4.5 --- api/tasks/getDetails.cfm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/tasks/getDetails.cfm b/api/tasks/getDetails.cfm index e57beba..b629fea 100644 --- a/api/tasks/getDetails.cfm +++ b/api/tasks/getDetails.cfm @@ -74,7 +74,7 @@ LEFT JOIN Businesses b ON b.ID = t.BusinessID LEFT JOIN ServicePoints sp ON sp.ID = o.ServicePointID LEFT JOIN ServicePoints tsp ON tsp.ID = t.ServicePointID - LEFT JOIN Users u ON u.ID = COALESCE(NULLIF(t.UserID, 0), o.UserID) + LEFT JOIN Users u ON u.ID = COALESCE(o.UserID, t.UserID) WHERE t.ID = ? ", [ { value = TaskID, cfsqltype = "cf_sql_integer" } ], { datasource = "payfrit" })>