refactor: refs #7490 Deleted update duaInvoiceInBooking
gitea/salix/pipeline/pr-dev Build queued... Details

This commit is contained in:
Guillermo Bonet 2024-06-10 08:38:58 +02:00
parent 379d7ef2ab
commit 9b21cd5eb1
1 changed files with 3 additions and 13 deletions

View File

@ -1,5 +1,7 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`duaInvoiceInBooking`(vDuaFk INT)
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`duaInvoiceInBooking`(
vDuaFk INT
)
BEGIN
/**
* Genera el asiento de un DUA y marca las entradas como confirmadas
@ -22,18 +24,6 @@ BEGIN
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
UPDATE invoiceIn ii
JOIN entry e ON e.invoiceInFk = ii.id
JOIN duaEntry de ON de.entryFk = e.id
JOIN dua d ON d.id = de.duaFk
SET ii.booked = IFNULL(ii.booked, d.booked),
ii.operated = IFNULL(ii.operated, d.operated),
ii.issued = IFNULL(ii.issued, d.issued),
ii.bookEntried = IFNULL(ii.bookEntried, d.bookEntried),
e.isBooked = TRUE,
e.isConfirmed = TRUE
WHERE d.id = vDuaFk;
SELECT ASIEN INTO vBookEntry FROM dua WHERE id = vDuaFk;
IF vBookEntry IS NULL THEN