Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7028-itemRequestConfDeny
This commit is contained in:
commit
a6bb381b74
|
@ -11,6 +11,7 @@ BEGIN
|
|||
DECLARE vCurrentCommission INT;
|
||||
DECLARE vIsNotEUR INT;
|
||||
DECLARE vLastEntryFk INT;
|
||||
DECLARE vLanded INT;
|
||||
|
||||
SELECT count(*) INTO vIsNotEUR
|
||||
FROM currency c
|
||||
|
@ -26,23 +27,25 @@ BEGIN
|
|||
|
||||
RETURN IFNULL(vCommission, 0);
|
||||
ELSE
|
||||
SELECT landed INTO vLanded
|
||||
FROM travel
|
||||
WHERE id = vTravelFk;
|
||||
|
||||
SELECT e.id INTO vLastEntryFk
|
||||
FROM `entry` e
|
||||
JOIN travel tr ON tr.id = e.travelFk
|
||||
WHERE e.supplierFk = vSupplierFk
|
||||
ORDER BY tr.landed DESC
|
||||
LIMIT 1;
|
||||
WHERE e.supplierFk = vSupplierFk
|
||||
ORDER BY (vLanded <= tr.landed), tr.landed DESC
|
||||
LIMIT 1;
|
||||
|
||||
IF vLastEntryFk THEN
|
||||
SELECT commission INTO vCurrentCommission
|
||||
FROM `entry`
|
||||
WHERE id = vLastEntryFk;
|
||||
|
||||
ELSE
|
||||
SELECT commission INTO vCurrentCommission
|
||||
FROM supplier s
|
||||
WHERE s.id = vSupplierFk;
|
||||
|
||||
END IF;
|
||||
|
||||
RETURN vCurrentCommission;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
"userFk": {
|
||||
"type": "number"
|
||||
},
|
||||
"simSerialNumber": {
|
||||
"simFk": {
|
||||
"type": "string"
|
||||
},
|
||||
"created": {
|
||||
|
|
Loading…
Reference in New Issue