fix: refs #8069 order_confirmWithUser
gitea/salix/pipeline/pr-master Build queued... Details

This commit is contained in:
Pako Natek 2024-10-07 14:25:46 +02:00
parent 33a4061058
commit 20836d734c
1 changed files with 15 additions and 0 deletions

View File

@ -13,6 +13,7 @@ BEGIN
*/
DECLARE vHasRows BOOL;
DECLARE vDone BOOL;
DECLARE vHas0Amount BOOL;
DECLARE vWarehouseFk INT;
DECLARE vShipment DATE;
DECLARE vShipmentDayEnd DATETIME;
@ -97,6 +98,20 @@ BEGIN
SELECT employeeFk INTO vUserFk FROM orderConfig;
END IF;
CALL orderRow_updateOverstocking(vSelf);
-- Check if any product has a quantity of 0
SELECT EXISTS (
SELECT id
FROM orderRow
WHERE orderFk = vSelf
AND amount = 0
) INTO vHas0Amount;
IF vHas0Amount THEN
CALL util.throw('Remove lines with quantity = 0 before confirming');
END IF;
START TRANSACTION;
CALL order_checkEditable(vSelf);