2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
|
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `stock`.`inbound_afterDelete`
|
|
|
|
AFTER DELETE ON `inbound`
|
|
|
|
FOR EACH ROW
|
|
|
|
BEGIN
|
|
|
|
UPDATE outbound o
|
|
|
|
JOIN inboundPick ou ON ou.outboundFk = o.id
|
|
|
|
SET o.lack = o.lack + ou.quantity,
|
|
|
|
o.isSync = FALSE
|
|
|
|
WHERE ou.inboundFk = OLD.id;
|
|
|
|
|
|
|
|
DELETE FROM inboundPick
|
|
|
|
WHERE inboundFk = OLD.id;
|
|
|
|
|
2024-04-08 07:11:40 +00:00
|
|
|
CALL visible_log(
|
2024-01-15 11:31:03 +00:00
|
|
|
OLD.isPicked,
|
2024-04-08 07:11:40 +00:00
|
|
|
OLD.warehouseFk,
|
|
|
|
OLD.itemFk,
|
|
|
|
-OLD.quantity
|
2024-01-15 11:31:03 +00:00
|
|
|
);
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|