From 628172c31cce8d5eec8d2515a4b524aabb95eda0 Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Mon, 16 Mar 2026 23:21:41 -0700 Subject: [PATCH] Add TaskTypeID=0 to order task creation INSERTs submitCash.php, submit.php, and webhook.php were creating kitchen tasks without TaskTypeID, which is NOT NULL with no default. This caused cash order submission to fail with a SQL error. Co-Authored-By: Claude Opus 4.6 (1M context) --- api/orders/submit.php | 4 ++-- api/orders/submitCash.php | 4 ++-- api/stripe/webhook.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/orders/submit.php b/api/orders/submit.php index 23d9dfd..cef3e4d 100644 --- a/api/orders/submit.php +++ b/api/orders/submit.php @@ -207,8 +207,8 @@ try { ); if (!$qExistingTask) { queryTimed(" - INSERT INTO Tasks (BusinessID, OrderID, ServicePointID, Title, CreatedOn, ClaimedByUserID) - VALUES (?, ?, ?, ?, NOW(), 0) + INSERT INTO Tasks (BusinessID, OrderID, ServicePointID, TaskTypeID, Title, CreatedOn, ClaimedByUserID) + VALUES (?, ?, ?, 0, ?, NOW(), 0) ", [$qOrder['BusinessID'], $OrderID, $spID > 0 ? $spID : null, $taskTitle]); } diff --git a/api/orders/submitCash.php b/api/orders/submitCash.php index 508025e..5a9ae03 100644 --- a/api/orders/submitCash.php +++ b/api/orders/submitCash.php @@ -110,8 +110,8 @@ try { $taskTitle = "Prepare Order #{$OrderID} for {$spName}"; queryTimed(" - INSERT INTO Tasks (BusinessID, OrderID, ServicePointID, Title, CreatedOn, ClaimedByUserID) - VALUES (?, ?, ?, ?, NOW(), 0) + INSERT INTO Tasks (BusinessID, OrderID, ServicePointID, TaskTypeID, Title, CreatedOn, ClaimedByUserID) + VALUES (?, ?, ?, 0, ?, NOW(), 0) ", [$qOrder['BusinessID'], $OrderID, $spID > 0 ? $spID : null, $taskTitle]); $response = [ diff --git a/api/stripe/webhook.php b/api/stripe/webhook.php index 55c77de..2ecaac6 100644 --- a/api/stripe/webhook.php +++ b/api/stripe/webhook.php @@ -95,8 +95,8 @@ try { $taskTitle = "Prepare Order #$orderID for $tableName"; queryTimed(" - INSERT INTO Tasks (BusinessID, OrderID, ServicePointID, Title, CreatedOn, ClaimedByUserID) - VALUES (?, ?, ?, ?, NOW(), 0) + INSERT INTO Tasks (BusinessID, OrderID, ServicePointID, TaskTypeID, Title, CreatedOn, ClaimedByUserID) + VALUES (?, ?, ?, 0, ?, NOW(), 0) ", [$qOrder['BusinessID'], $orderID, (int) ($qOrder['ServicePointID'] ?? 0), $taskTitle]); } }