This commit is contained in:
parent
166b74c70d
commit
184a3a3c7a
|
@ -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`);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue