8179-testToMaster #3176
|
@ -2,6 +2,17 @@ DELIMITER $$
|
|||
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`itemShelving_beforeDelete`
|
||||
BEFORE DELETE ON `itemShelving`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
DECLARE vItemShelvingSaleExists BOOL;
|
||||
|
||||
SELECT COUNT(*) INTO vItemShelvingSaleExists
|
||||
FROM itemShelvingSale
|
||||
WHERE itemShelvingFk = OLD.id;
|
||||
|
||||
IF vItemShelvingSaleExists AND @canDeleteItemShelvingSale IS NULL THEN
|
||||
CALL util.throw('Cannot delete item shelving with item shelving sale');
|
||||
END IF;
|
||||
|
||||
INSERT INTO vn.itemShelvingLog(itemShelvingFk,
|
||||
workerFk,
|
||||
accion,
|
||||
|
@ -11,5 +22,6 @@ INSERT INTO vn.itemShelvingLog(itemShelvingFk,
|
|||
account.myUser_getId(),
|
||||
'ELIMINADO',
|
||||
OLD.shelvingFk,
|
||||
OLD.itemFk)$$
|
||||
OLD.itemFk);
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
Loading…
Reference in New Issue