feat: refs #6395 Added buyerFk in buy #2020

Merged
guillermo merged 5 commits from 6395-buyBuyerFk into dev 2024-03-20 09:09:16 +00:00
2 changed files with 15 additions and 2 deletions
Showing only changes of commit 184a3a3c7a - Show all commits

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();
guillermo marked this conversation as resolved Outdated

Se debe de consultar el comprador del tipo de artículo

Se debe de consultar el comprador del tipo de artículo
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
guillermo marked this conversation as resolved
Review

Se debe de consultar el comprador del tipo de artículo

Se debe de consultar el comprador del tipo de artículo
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