diff --git a/db/routines/vn/procedures/buy_chekItem.sql b/db/routines/vn/procedures/buy_checkItem.sql similarity index 63% rename from db/routines/vn/procedures/buy_chekItem.sql rename to db/routines/vn/procedures/buy_checkItem.sql index e9e9336b7..1144db889 100644 --- a/db/routines/vn/procedures/buy_chekItem.sql +++ b/db/routines/vn/procedures/buy_checkItem.sql @@ -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 ; \ No newline at end of file +DELIMITER ;