feat: refs #6395 Added buyerFk in buy

This commit is contained in:
Guillermo Bonet 2024-02-09 14:00:16 +01:00
parent 3ee63e489e
commit c8b156771d
3 changed files with 6 additions and 0 deletions

View File

@ -19,6 +19,7 @@ trig: BEGIN
END IF; END IF;
SET NEW.editorFk = account.myUser_getId(); SET NEW.editorFk = account.myUser_getId();
SET NEW.buyerFk = NEW.editorFk;
CALL buy_checkGrouping(NEW.`grouping`); CALL buy_checkGrouping(NEW.`grouping`);

View File

@ -65,6 +65,10 @@ trig:BEGIN
SET NEW.isIgnored = TRUE; SET NEW.isIgnored = TRUE;
END IF; END IF;
IF NOT (NEW.itemFk <=> OLD.itemFk) THEN
SET NEW.buyerFk = NEW.editorFk;
END IF;
IF NOT (NEW.itemFk <=> OLD.itemFk) OR IF NOT (NEW.itemFk <=> OLD.itemFk) OR
NOT (OLD.entryFk <=> NEW.entryFk) THEN NOT (OLD.entryFk <=> NEW.entryFk) THEN
CREATE OR REPLACE TEMPORARY TABLE tmp.buysToCheck CREATE OR REPLACE TEMPORARY TABLE tmp.buysToCheck

View File

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