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) <noreply@anthropic.com>
This commit is contained in:
John Mizerek 2026-03-16 23:21:41 -07:00
parent b5394aec7c
commit 628172c31c
3 changed files with 6 additions and 6 deletions

View file

@ -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]);
}

View file

@ -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 = [

View file

@ -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]);
}
}