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.zoneGetAgency(#address, #date); SELECT DISTINCT a.agencyModeFk id, a.description FROM tmp.zoneGetAgency a JOIN vn.deliveryMethod d ON d.id = a.deliveryMethodFk WHERE d.code IN ('AGENCY', 'DELIVERY') ORDER BY a.description; DROP TEMPORARY TABLE tmp.zoneGetAgency; CALL vn.zoneGetAgency(#address, #date); SELECT DISTINCT a.agencyModeFk id, a.description FROM tmp.zoneGetAgency a JOIN vn.deliveryMethod d ON d.id = a.deliveryMethodFk WHERE d.code IN ('PICKUP') ORDER BY a.description; DROP TEMPORARY TABLE tmp.zoneGetAgency;

ConfigureOrder

DeliveryOrPickupQuestion

SELECT a.id, a.nickname, p.name province, a.city, a.street, a.isActive, c.country FROM myAddress a LEFT JOIN vn.province p ON p.id = a.provinceFk JOIN vn.country c ON c.id = p.countryFk WHERE a.isActive

AgencyQuestion

PickupWarehouseQuestion

ConfirmToAccessCatalog

Arrival

Agency

ConfirmToAccessCatalog

Pickup

Warehouse