feat: refs #8401 create triggers to itemTaxCountry #3370
|
@ -0,0 +1,8 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`itemTaxCountry_beforeDelete`
|
||||
BEFORE DELETE ON `itemTaxCountry`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
CALL util.throw('Records in this table cannot be deleted');
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -4,5 +4,9 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`itemTaxCountry_beforeUp
|
|||
FOR EACH ROW
|
||||
BEGIN
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
|
||||
IF NOT(NEW.`countryFk` <=> OLD.`countryFk`) OR NOT(NEW.`itemFk` <=> OLD.`itemFk`) THEN
|
||||
CALL util.throw('Only the VAT can be modified');
|
||||
END IF;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
Loading…
Reference in New Issue