salix/db/routines/vn/triggers/duaTax_beforeUpdate.sql

10 lines
259 B
MySQL
Raw Normal View History

DELIMITER $$
2024-01-25 16:33:54 +00:00
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`duaTax_beforeUpdate`
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 ;