-- --------------------------------------------------------
-- Server OS:                    Linux
-- HeidiSQL Version:             11.0.0.5919
-- --------------------------------------------------------

USE inventory;
-- Dumping structure for trigger inventory.purchase_order_after_update
DROP TRIGGER IF EXISTS `purchase_order_after_update`;
SET @OLDTMP_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_ENGINE_SUBSTITUTION';
DELIMITER //
CREATE TRIGGER `purchase_order_after_update` AFTER UPDATE ON `purchase_order` FOR EACH ROW BEGIN
	IF OLD.STATUS != NEW.STATUS THEN
		UPDATE inventory.purchase_order_detil SET STATUS = NEW.STATUS WHERE ID_PO = OLD.NO_PO;
	END IF;
END//
DELIMITER ;

