8355-testToMaster #3336
|
@ -11,7 +11,7 @@ BEGIN
|
||||||
DECLARE vCurrentCommission INT;
|
DECLARE vCurrentCommission INT;
|
||||||
DECLARE vIsNotEUR INT;
|
DECLARE vIsNotEUR INT;
|
||||||
DECLARE vLastEntryFk INT;
|
DECLARE vLastEntryFk INT;
|
||||||
DECLARE vTravelFkLanded INT;
|
DECLARE vLanded INT;
|
||||||
|
|
||||||
SELECT count(*) INTO vIsNotEUR
|
SELECT count(*) INTO vIsNotEUR
|
||||||
FROM currency c
|
FROM currency c
|
||||||
|
@ -27,7 +27,7 @@ BEGIN
|
||||||
|
|
||||||
RETURN IFNULL(vCommission, 0);
|
RETURN IFNULL(vCommission, 0);
|
||||||
ELSE
|
ELSE
|
||||||
SELECT landed INTO vTravelFkLanded
|
SELECT landed INTO vLanded
|
||||||
FROM travel
|
FROM travel
|
||||||
WHERE id = vTravelFk;
|
WHERE id = vTravelFk;
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ BEGIN
|
||||||
FROM `entry` e
|
FROM `entry` e
|
||||||
JOIN travel tr ON tr.id = e.travelFk
|
JOIN travel tr ON tr.id = e.travelFk
|
||||||
WHERE e.supplierFk = vSupplierFk
|
WHERE e.supplierFk = vSupplierFk
|
||||||
ORDER BY (vTravelFkLanded <= tr.landed) ASC, tr.landed DESC
|
ORDER BY (vLanded <= tr.landed), tr.landed DESC
|
||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
|
|
||||||
IF vLastEntryFk THEN
|
IF vLastEntryFk THEN
|
||||||
|
|
Loading…
Reference in New Issue