TYPE=TRIGGERS
triggers='CREATE DEFINER=`root`@`localhost` TRIGGER `TrRetJualAdd` AFTER INSERT ON `tr_retjual_m` FOR EACH ROW BEGIN\nDeclare vPiutang double;\nDeclare vSisa double;\n  select ifnull(Piutang,0) into vPiutang from tm_Customer where kodeCust = new.kodeCust; \n  Update tm_Customer set Piutang =  ifnull(Piutang,0) - new.nilai * new.exrate \n  where kodeCust = new.kodeCust;\n  Update tr_Jual_m set sisa =  ifnull(sisa,0) - new.nilai * new.exrate \n  where TransJual = new.TransJual and NoJual=New.NoJual;\nend' 'CREATE DEFINER=`root`@`localhost` TRIGGER `TrRetJualUpdate` AFTER UPDATE ON `tr_retjual_m` FOR EACH ROW BEGIN\nDeclare vPiutang double;\nDeclare vSisa double;\n  select ifnull(Piutang,0) into vPiutang from tm_Customer where kodeCust = new.kodeCust; \n  Update tm_Customer set Piutang =  ifnull(Piutang,0) - new.nilai * new.exrate \n  where kodeCust = new.kodeCust;\n  Update tm_Customer set Piutang =  ifnull(Piutang,0) + Old.nilai * Old.exrate \n  where kodeCust = Old.kodeCust;\n  Update tr_Jual_m set sisa =  ifnull(sisa,0) - new.nilai * new.exrate \n  where TransJual = new.TransJual and NoJual=New.NoJual;\n  Update tr_Jual_m set sisa =  ifnull(sisa,0) + old.nilai * old.exrate \n  where TransJual = old.TransJual and NoJual=old.NoJual;\nend' 'CREATE DEFINER=`root`@`localhost` TRIGGER `TrRetJualDelete` AFTER DELETE ON `tr_retjual_m` FOR EACH ROW BEGIN\nDeclare vSisa double;\n  Update tm_Customer set Piutang =  ifnull(Piutang,0) + Old.nilai * Old.exrate \n  where kodeCust = Old.kodeCust;\n  Update tr_Jual_m set sisa =  ifnull(sisa,0) + old.nilai * old.exrate \n  where TransJual = old.TransJual and NoJual=old.NoJual;\nend'
sql_modes=524288 524288 524288
definers='root@localhost' 'root@localhost' 'root@localhost'
