|
DELIMITER $$
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`duaTax_BEFORE_UPDATE`
|
|
BEFORE UPDATE ON `duaTax`
|
|
FOR EACH ROW
|
|
BEGIN
|
|
SET NEW.rate = duaTax_getRate(NEW.duaFk, NEW.taxClassFk);
|
|
SET NEW.tax = NEW.base * NEW.rate / 100;
|
|
END$$
|
|
DELIMITER ;
|