SELECT deliveryMethod, agencyModeFk, addressFk, defaultAgencyFk
FROM myBasketDefaults
SELECT m.code deliveryMethod, o.sent, o.agencyModeFk, o.addressFk
FROM myBasket o
JOIN vn.deliveryMethod m ON m.id = o.deliveryMethodFk
CALL vn.agencyListAvailable (#date, #address);
SELECT DISTINCT m.id, m.description
FROM tmp.agencyAvailable a
JOIN vn.agencyMode m
ON m.agencyFk = a.agencyFk
JOIN vn.deliveryMethod d
ON d.id = m.deliveryMethodFk
WHERE d.code IN ('AGENCY', 'DELIVERY')
ORDER BY m.description;
DROP TEMPORARY TABLE tmp.agencyAvailable;
CALL vn.agencyListAvailable (#date, #address);
SELECT DISTINCT m.id, m.description
FROM tmp.agencyAvailable a
JOIN vn.agencyMode m
ON m.agencyFk = a.agencyFk
JOIN vn.deliveryMethod d
ON d.id = m.deliveryMethodFk
WHERE d.code IN ('PICKUP')
ORDER BY m.description;
DROP TEMPORARY TABLE tmp.agencyAvailable;
ConfigureOrder