fix: available refs #6861
gitea/salix/pipeline/pr-master There was a failure building this commit Details

This commit is contained in:
Sergio De la torre 2024-09-11 12:47:51 +02:00
parent 07f7f87c28
commit 87182abf7e
2 changed files with 8 additions and 2 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
@ -55,6 +56,7 @@ BEGIN
itemFk,
shelvingFk,
visible,
available,
grouping,
packing,
packagingFk,
@ -62,6 +64,7 @@ BEGIN
SELECT vItemFk,
vShelvingFk,
vQuantity,
available,
IFNULL(vGrouping, b.grouping),
IFNULL(vPacking, b.packing),
IFNULL(vPackagingFk, b.packagingFk),

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;