2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
|
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `stock`.`outbound_afterDelete`
|
|
|
|
AFTER DELETE ON `outbound`
|
|
|
|
FOR EACH ROW
|
|
|
|
BEGIN
|
|
|
|
UPDATE inbound i
|
|
|
|
JOIN inboundPick ou ON ou.inboundFk = i.id
|
|
|
|
SET i.available = i.available + ou.quantity,
|
|
|
|
i.isSync = FALSE
|
|
|
|
WHERE ou.outboundFk = OLD.id;
|
|
|
|
|
|
|
|
DELETE FROM inboundPick
|
|
|
|
WHERE outboundFk = 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 ;
|