feat: bloquear facturas recibidas contabilizadas refs #7173
gitea/salix/pipeline/pr-dev Build queued... Details

This commit is contained in:
Carlos Andrés 2024-04-04 18:05:45 +02:00
parent bd661befb6
commit d18721f50d
10 changed files with 10 additions and 9 deletions

View File

@ -1,5 +1,5 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`invoiceIn_checkBooked`(
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`invoiceIn_checkIsBooked`(
vSelf INT
)
BEGIN

View File

@ -3,6 +3,6 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`invoiceInCorrection_b
BEFORE DELETE ON `invoiceInCorrection`
FOR EACH ROW
BEGIN
CALL invoiceIn_checkBooked(OLD.correctingFk);
CALL invoiceIn_checkIsBooked(OLD.correctingFk);
END$$
DELIMITER ;

View File

@ -3,6 +3,6 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`invoiceInDueDay_befor
BEFORE DELETE ON `invoiceInDueDay`
FOR EACH ROW
BEGIN
CALL invoiceIn_checkBooked(OLD.id);
CALL invoiceIn_checkIsBooked(OLD.id);
END$$
DELIMITER ;

View File

@ -5,7 +5,6 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`invoiceInDueDay_befor
BEGIN
DECLARE vIsNotified BOOLEAN;
CALL invoiceIn_checkBooked(OLD.invoiceInFk);
SET NEW.editorFk = account.myUser_getId();
SELECT isNotified INTO vIsNotified

View File

@ -5,6 +5,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`invoiceInDueDay_befor
BEGIN
DECLARE vIsNotified BOOLEAN;
CALL invoiceIn_checkBooked(OLD.invoiceInFk);
SET NEW.editorFk = account.myUser_getId();
SELECT isNotified INTO vIsNotified

View File

@ -3,6 +3,6 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`invoiceInIntrastat_be
BEFORE DELETE ON `invoiceInIntrastat`
FOR EACH ROW
BEGIN
CALL invoiceIn_checkBooked(OLD.invoiceInFk);
CALL invoiceIn_checkIsBooked(OLD.invoiceInFk);
END$$
DELIMITER ;

View File

@ -3,6 +3,6 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`invoiceInTax_beforeDe
BEFORE DELETE ON `invoiceInTax`
FOR EACH ROW
BEGIN
CALL invoiceIn_checkBooked(OLD.invoiceInFk);
CALL invoiceIn_checkIsBooked(OLD.invoiceInFk);
END$$
DELIMITER ;

View File

@ -3,7 +3,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`invoiceInTax_beforeUp
BEFORE UPDATE ON `invoiceInTax`
FOR EACH ROW
BEGIN
CALL invoiceIn_checkBooked(OLD.invoiceInFk);
CALL invoiceIn_checkIsBooked(OLD.invoiceInFk);
IF NOT (NEW.invoiceInFk <=> OLD.invoiceInFk) THEN
CALL invoiceInTax_afterUpsert(NEW.invoiceInFk);

View File

@ -3,7 +3,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`invoiceIn_afterDelete
AFTER DELETE ON `invoiceIn`
FOR EACH ROW
BEGIN
CALL invoiceIn_checkBooked(OLD.id);
CALL invoiceIn_checkIsBooked(OLD.id);
INSERT INTO invoiceInLog
SET `action` = 'delete',

View File

@ -3,6 +3,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`invoiceIn_afterUpdate
AFTER UPDATE ON `invoiceIn`
FOR EACH ROW
BEGIN
CALL invoiceIn_checkIsBooked(OLD.id);
IF NEW.issued != OLD.issued
OR NEW.currencyFk != OLD.currencyFk THEN