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
3 changed files with 19 additions and 0 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;
@ -20,6 +21,13 @@ trig: BEGIN
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
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`);
SELECT t.warehouseInFk, t.landed

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;
@ -65,6 +66,15 @@ trig:BEGIN
SET NEW.isIgnored = TRUE;
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
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
NOT (OLD.entryFk <=> NEW.entryFk) THEN
CREATE OR REPLACE TEMPORARY TABLE tmp.buysToCheck

View File

@ -0,0 +1 @@
ALTER TABLE vn.buy ADD buyerFk int(10) unsigned DEFAULT NULL NULL;