SELECT b.id, b.sent, a.description agency, m.code method FROM myBasket b JOIN vn.agencyMode a ON a.id = b.agencyModeFk JOIN vn.deliveryMethod m ON m.id = b.deliveryMethodFk CREATE TEMPORARY TABLE tmp.item (INDEX (itemFk)) ENGINE = MEMORY SELECT i.id itemFk FROM vn.item i JOIN vn.itemType t ON t.id = i.typeFk WHERE #filter; CALL myBasket_calcCatalogFull; SELECT i.id, i.description, i.longName item, i.subName, i.tag5, i.value5, i.tag6, i.value6, i.tag7, i.value7, i.relevancy, i.size, i.category, k.name ink, p.name producer, o.name origin, b.available, b.price, b.`grouping`, i.image, im.updated FROM tmp.ticketCalculateItem b JOIN vn.item i ON i.id = b.itemFk LEFT JOIN vn.ink k ON k.id = i.inkFk LEFT JOIN vn.producer p ON p.id = i.producerFk LEFT JOIN vn.origin o ON o.id = i.originFk LEFT JOIN image im ON im.collectionFk = 'catalog' AND im.name = i.image WHERE b.available > 0 ORDER BY i.relevancy DESC, i.name, i.size LIMIT 5000;

Catalog

SELECT c.id, l.name, c.color, c.code FROM vn.itemCategory c JOIN vn.itemCategoryL10n l ON l.id = c.id WHERE c.display ORDER BY display

Choose a realm

Filter by

CALL myBasket_getAvailable; SELECT DISTINCT t.id, l.name FROM vn.item i JOIN vn.itemType t ON t.id = i.typeFk JOIN tmp.itemAvailable a ON a.id = i.id JOIN vn.itemTypeL10n l ON l.id = t.id WHERE t.`order` >= 0 AND #filter ORDER BY t.`order`, l.name CALL myBasket_getAvailable; SELECT DISTINCT l.id, l.name FROM vn.item i JOIN vn.itemType t ON t.id = i.typeFk JOIN tmp.itemAvailable a ON a.id = i.id JOIN vn.inkL10n l ON l.id = i.inkFk WHERE #filter ORDER BY name CALL myBasket_getAvailable; SELECT DISTINCT p.id, p.name FROM vn.item i JOIN vn.itemType t ON t.id = i.typeFk JOIN tmp.itemAvailable a ON a.id = i.id JOIN vn.producer p ON p.id = i.producerFk WHERE #filter ORDER BY name CALL myBasket_getAvailable; SELECT DISTINCT o.id, l.name, o.code FROM vn.item i JOIN vn.itemType t ON t.id = i.typeFk JOIN tmp.itemAvailable a ON a.id = i.id JOIN vn.origin o ON o.id = i.originFk JOIN vn.originL10n l ON l.id = o.id WHERE #filter ORDER BY name CALL myBasket_getAvailable; SELECT DISTINCT i.category, i.category FROM vn.item i JOIN vn.itemType t ON t.id = i.typeFk JOIN tmp.itemAvailable a ON a.id = i.id WHERE #filter ORDER BY category

Order by

SELECT i.description, o.name origin FROM vn.item i LEFT JOIN vn.originL10n o ON o.id = i.originFk WHERE i.id = #item

@

SELECT l.name, it.value FROM vn.itemTag it JOIN vn.tag t ON t.id = it.tagFk JOIN vn.tagL10n l ON l.id = t.id WHERE it.itemFk = #item AND priority >= 0 ORDER BY it.priority
CALL myBasket_calcCatalogFromItem(#item); SELECT l.warehouseFk, w.name warehouse, p.`grouping`, p.price, p.priceKg, p.rate, l.available FROM tmp.ticketLot l JOIN tmp.ticketComponentPrice p ON p.warehouseFk = l.warehouseFk JOIN vn.warehouse w ON w.id = p.warehouseFk ORDER BY warehouseFk, `grouping`;