feat: validar caracteres invocieIn.supplierref #6931
gitea/salix/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Carlos Andrés 2024-02-23 15:58:00 +01:00
parent a731e94c34
commit 29a96ede56
4 changed files with 3 additions and 4 deletions

View File

@ -1,5 +1,5 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `util`.`string_checkPrintableAndSpanishChars`( CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `util`.`checkPrintableChars`(
vString VARCHAR(255) vString VARCHAR(255)
) RETURNS tinyint(1) ) RETURNS tinyint(1)
DETERMINISTIC DETERMINISTIC

View File

@ -10,7 +10,7 @@ BEGIN
DECLARE vWithholdingSageFk INT; DECLARE vWithholdingSageFk INT;
IF NOT util.string_checkPrintableAndSpanishChars(NEW.supplierRef) THEN IF NOT util.string_checkPrintableAndSpanishChars(NEW.supplierRef) THEN
CALL util.throw('The invoiceIn cannot contain special characters'); CALL util.throw('The invoiceIn reference contains invalid characters');
END IF; END IF;
SET NEW.editorFk = account.myUser_getId(); SET NEW.editorFk = account.myUser_getId();

View File

@ -6,7 +6,7 @@ BEGIN
DECLARE vWithholdingSageFk INT; DECLARE vWithholdingSageFk INT;
IF NOT (NEW.supplierRef <=> OLD.supplierRef) AND NOT util.string_checkPrintableAndSpanishChars(NEW.supplierRef) THEN IF NOT (NEW.supplierRef <=> OLD.supplierRef) AND NOT util.string_checkPrintableAndSpanishChars(NEW.supplierRef) THEN
CALL util.throw('The invoiceIn cannot contain special characters'); CALL util.throw('The invoiceIn reference contains invalid characters');
END IF; END IF;
SET NEW.editorFk = account.myUser_getId(); SET NEW.editorFk = account.myUser_getId();

View File

@ -1 +0,0 @@
-- Place your SQL code here