8144-devToTest_2448 #3216
|
@ -25,18 +25,17 @@ BEGIN
|
||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
|
|
||||||
RETURN IFNULL(vCommission, 0);
|
RETURN IFNULL(vCommission, 0);
|
||||||
|
|
||||||
ELSE
|
ELSE
|
||||||
SELECT e.id INTO vLastEntryFk
|
SELECT e.id INTO vLastEntryFk
|
||||||
FROM vn.entry e
|
FROM `entry` e
|
||||||
JOIN vn.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 tr.landed DESC
|
ORDER BY tr.landed DESC
|
||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
|
|
||||||
IF vLastEntryFk THEN
|
IF vLastEntryFk THEN
|
||||||
SELECT commission INTO vCurrentCommission
|
SELECT commission INTO vCurrentCommission
|
||||||
FROM vn.entry
|
FROM `entry`
|
||||||
WHERE id = vLastEntryFk;
|
WHERE id = vLastEntryFk;
|
||||||
|
|
||||||
ELSE
|
ELSE
|
||||||
|
@ -47,8 +46,6 @@ BEGIN
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
RETURN vCurrentCommission;
|
RETURN vCurrentCommission;
|
||||||
|
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
Loading…
Reference in New Issue