Merge pull request 'feat: refs #4515 New throw buy_checkItem' (!2935) from 4515-throwBuyCheck into dev
gitea/salix/pipeline/head There was a failure building this commit Details

Reviewed-on: #2935
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
Guillermo Bonet 2024-09-09 07:07:53 +00:00
commit 0c4b9dcdae
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
@ -19,10 +20,10 @@ BEGIN
AND a.hasWeightVolumetric
LIMIT 1;
DROP TEMPORARY TABLE tmp.buysToCheck;
DROP TEMPORARY TABLE tmp.buysToCheck;
IF hasVolumetricAgency THEN
CALL util.throw('Item lacks size/weight in purchase line at agency');
END IF;
IF vHasVolumetricAgency THEN
CALL util.throw(CONCAT('Missing size/weight in buy line at agency, item: ', vItemFk));
END IF;
END$$
DELIMITER ;
DELIMITER ;