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');
|
||||||
robert marked this conversation as resolved
Outdated
|
|||||||
|
END$$
|
||||||
|
DELIMITER ;
|
|
@ -4,5 +4,9 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`itemTaxCountry_beforeUp
|
||||||
FOR EACH ROW
|
FOR EACH ROW
|
||||||
BEGIN
|
BEGIN
|
||||||
SET NEW.editorFk = account.myUser_getId();
|
SET NEW.editorFk = account.myUser_getId();
|
||||||
|
|
||||||
|
IF NOT(NEW.`countryFk` <=> OLD.`countryFk`) OR NOT(NEW.`itemFk` <=> OLD.`itemFk`) THEN
|
||||||
robert marked this conversation as resolved
Outdated
jgallego
commented
el itemFk tampoc es pot canviar el itemFk tampoc es pot canviar
|
|||||||
|
CALL util.throw('Only the VAT can be modified');
|
||||||
|
END IF;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
Loading…
Reference in New Issue
mes sencill posar ací directament call util.throw