fix: refs #4948 ticket_selfConsumptionPackaging
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Guillermo Bonet 2024-11-26 09:01:04 +01:00
parent 4fc3006298
commit 2eed2f00a9
1 changed files with 7 additions and 3 deletions

View File

@ -3,7 +3,7 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`expedition_selfConsum
vSelf INT, vSelf INT,
vAction ENUM('add', 'remove') vAction ENUM('add', 'remove')
) )
BEGIN proc:BEGIN
/** /**
* Maneja el consumo de cajas para autoconsumo, permitiendo * Maneja el consumo de cajas para autoconsumo, permitiendo
* añadir o quitar cajas utilizadas según la acción indicada. * añadir o quitar cajas utilizadas según la acción indicada.
@ -37,8 +37,8 @@ BEGIN
vWarehouseFk, vWarehouseFk,
vCreated vCreated
FROM expedition e FROM expedition e
JOIN packaging p ON p.id = e.packagingFk LEFT JOIN packaging p ON p.id = e.packagingFk
JOIN item i ON i.id = p.itemFk LEFT JOIN item i ON i.id = p.itemFk
JOIN ticket t ON t.id = e.ticketFk JOIN ticket t ON t.id = e.ticketFk
JOIN productionConfig pc JOIN productionConfig pc
WHERE e.id = vSelf; WHERE e.id = vSelf;
@ -47,6 +47,10 @@ BEGIN
CALL util.throw('Some config parameters are not set'); CALL util.throw('Some config parameters are not set');
END IF; END IF;
IF vItemFk IS NULL THEN
LEAVE proc;
END IF;
SET vCreated = DATE(vCreated); SET vCreated = DATE(vCreated);
SELECT id INTO vTicketFk SELECT id INTO vTicketFk