refs #6395 Requested changes
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Guillermo Bonet 2024-03-14 10:05:25 +01:00
parent 166b74c70d
commit 184a3a3c7a
2 changed files with 15 additions and 2 deletions

View File

@ -9,6 +9,7 @@ trig: BEGIN
DECLARE vGroupingMode TINYINT;
DECLARE vGenericFk INT;
DECLARE vGenericInDate BOOL;
DECLARE vBuyerFk INT;
IF @isModeInventory THEN
LEAVE trig;
@ -19,7 +20,13 @@ trig: BEGIN
END IF;
SET NEW.editorFk = account.myUser_getId();
SET NEW.buyerFk = NEW.editorFk;
SELECT it.workerFk INTO vBuyerFk
FROM item i
JOIN itemType it ON it.id = i.typeFk
WHERE i.id = NEW.itemFk;
SET NEW.buyerFk = vBuyerFk;
CALL buy_checkGrouping(NEW.`grouping`);

View File

@ -7,6 +7,7 @@ trig:BEGIN
DECLARE vGenericInDate BOOL;
DECLARE vIsInventory BOOL;
DECLARE vDefaultEntry INT;
DECLARE vBuyerFk INT;
IF @isTriggerDisabled THEN
LEAVE trig;
@ -66,7 +67,12 @@ trig:BEGIN
END IF;
IF NOT (NEW.itemFk <=> OLD.itemFk) THEN
SET NEW.buyerFk = NEW.editorFk;
SELECT it.workerFk INTO vBuyerFk
FROM item i
JOIN itemType it ON it.id = i.typeFk
WHERE i.id = NEW.itemFk;
SET NEW.buyerFk = vBuyerFk;
END IF;
IF NOT (NEW.itemFk <=> OLD.itemFk) OR