Merge pull request 'fix: refs #7834 expeditionScan_Put' (!2832) from 7834-fixExpeditionScanPut into master
gitea/salix/pipeline/head This commit looks good Details
gitea/salix/pipeline/pr-dev This commit looks good Details

Reviewed-on: #2832
Reviewed-by: Sergio De la torre <sergiodt@verdnatura.es>
This commit is contained in:
Guillermo Bonet 2024-08-06 10:56:10 +00:00
commit ffa775a8a5
1 changed files with 14 additions and 7 deletions

View File

@ -1,11 +1,18 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`expeditionScan_Put`(vPalletFk INT, vExpeditionFk INT) CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`expeditionScan_Put`(
vPalletFk INT,
vExpeditionFk INT
)
BEGIN BEGIN
IF NOT (SELECT TRUE FROM expedition WHERE id = vExpeditionFk LIMIT 1) THEN
CALL util.throw('Expedition not exists');
END IF;
REPLACE vn.expeditionScan(expeditionFk, palletFk) IF NOT (SELECT TRUE FROM expeditionPallet WHERE id = vPalletFk LIMIT 1) THEN
CALL util.throw('Pallet not exists');
END IF;
REPLACE expeditionScan(expeditionFk, palletFk)
VALUES(vExpeditionFk, vPalletFk); VALUES(vExpeditionFk, vPalletFk);
SELECT LAST_INSERT_ID() INTO vPalletFk;
END$$ END$$
DELIMITER ; DELIMITER ;