Merge pull request '6861-availableReserve' (!2952) from 6861-availableReserve into master
gitea/salix/pipeline/head This commit looks good Details
gitea/salix/pipeline/pr-test This commit looks good Details

Reviewed-on: #2952
Reviewed-by: Carlos Andrés <carlosap@verdnatura.es>
This commit is contained in:
Sergio De la torre 2024-09-11 12:38:14 +00:00
commit 99761c97e8
2 changed files with 7 additions and 3 deletions

View File

@ -46,7 +46,8 @@ BEGIN
AND buyFk = vBuyFk) THEN
UPDATE itemShelving
SET visible = visible + vQuantity
SET visible = visible + vQuantity,
available = available + vQuantity
WHERE shelvingFk COLLATE utf8_unicode_ci = vShelvingFk AND itemFk = vItemFk AND packing = vPacking;
ELSE
@ -68,6 +69,6 @@ BEGIN
id
FROM buy b
WHERE id = vBuyFk;
END IF;
END IF;
END$$
DELIMITER ;

View File

@ -160,7 +160,10 @@ w1: WHILE vQuantity >= vPacking DO
UPDATE sale SET quantity = quantity - vPacking WHERE id = vSaleFk;
UPDATE itemShelving SET visible = visible - vPacking WHERE id = vItemShelvingFk;
UPDATE itemShelving
SET visible = visible - vPacking,
available = available - vPacking
WHERE id = vItemShelvingFk;
SET vNewSaleFk = NULL;