feat: refs #8401 create triggers to itemTaxCountry #3370

Merged
robert merged 5 commits from 8401-itemTaxCountryTrigger into master 2025-01-21 10:37:14 +00:00
2 changed files with 12 additions and 0 deletions

View File

@ -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

mes sencill posar ací directament call util.throw

mes sencill posar ací directament call util.throw
END$$
DELIMITER ;

View File

@ -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
robert marked this conversation as resolved Outdated

el itemFk tampoc es pot canviar

el itemFk tampoc es pot canviar
CALL util.throw('Only the VAT can be modified');
END IF;
END$$
DELIMITER ;