feat: refs #4515 New throw buy_checkItem
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Guillermo Bonet 2024-09-09 08:28:27 +02:00
parent 05b75c1f0d
commit c4527cc5c5
1 changed files with 8 additions and 7 deletions

View File

@ -6,9 +6,10 @@ BEGIN
*
* @param tmp.buysToCheck(id as INT).
*/
DECLARE hasVolumetricAgency INT;
DECLARE vHasVolumetricAgency INT;
DECLARE vItemFk INT;
SELECT a.hasWeightVolumetric INTO hasVolumetricAgency
SELECT a.hasWeightVolumetric, i.id INTO vHasVolumetricAgency, vItemFk
FROM entry e
JOIN travel t ON t.id = e.travelFk
JOIN agencyMode a ON a.id = t.agencyModeFk
@ -21,8 +22,8 @@ BEGIN
DROP TEMPORARY TABLE tmp.buysToCheck;
IF hasVolumetricAgency THEN
CALL util.throw('Item lacks size/weight in purchase line at agency');
IF vHasVolumetricAgency THEN
CALL util.throw(CONCAT('Missing size/weight in buy line at agency, item: ', vItemFk));
END IF;
END$$
DELIMITER ;