USE `inventory`;
DROP TRIGGER IF EXISTS `kode_barang_psedia_after_insert`;
SET @OLDTMP_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO';
DELIMITER //
CREATE TRIGGER `kode_barang_psedia_after_insert` AFTER INSERT ON `kode_barang_psedia` FOR EACH ROW BEGIN
	#UPDATE barang SET KODE_PSEDIA = CONCAT(NEW.KELOMPOK,LPAD(NEW.NOMOR, 6, '0')) WHERE ID = NEW.BARANG;
END//
DELIMITER ;
