Compare commits

...

4 Commits

Author SHA1 Message Date
Pako Natek 4b497108dc Merge pull request 'fix: refs #8069 call moved upper than transaction start' (!3075) from 8069-Overstocking into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3075
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2024-10-04 16:21:22 +00:00
Pako Natek cf29b1bd82 Merge branch 'dev' into 8069-Overstocking
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-10-04 16:19:59 +00:00
Pako Natek 04e5018bc9 Merge branch 'dev' into 8069-Overstocking
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-10-04 11:59:14 +00:00
Pako Natek 6766cebd2a fix: refs #8069 call moved upper than transaction start
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-10-04 13:56:54 +02:00
1 changed files with 14 additions and 14 deletions

View File

@ -98,22 +98,8 @@ BEGIN
SELECT employeeFk INTO vUserFk FROM orderConfig;
END IF;
START TRANSACTION;
CALL order_checkEditable(vSelf);
CALL orderRow_updateOverstocking(vSelf);
-- Check order is not empty
SELECT COUNT(*) > 0 INTO vHasRows
FROM orderRow
WHERE orderFk = vSelf
AND amount > 0;
IF NOT vHasRows THEN
CALL util.throw('ORDER_EMPTY');
END IF;
-- Check if any product has a quantity of 0
SELECT EXISTS (
SELECT id
@ -125,6 +111,20 @@ BEGIN
IF vHas0Amount THEN
CALL util.throw('Remove lines with quantity = 0 before confirming');
END IF;
START TRANSACTION;
CALL order_checkEditable(vSelf);
-- Check order is not empty
SELECT COUNT(*) > 0 INTO vHasRows
FROM orderRow
WHERE orderFk = vSelf
AND amount > 0;
IF NOT vHasRows THEN
CALL util.throw('ORDER_EMPTY');
END IF;
-- Crea los tickets del pedido
OPEN vDates;