DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `hedera`.`myTicket_getRows`(vSelf INT)
BEGIN
	SELECT r.itemFk, r.quantity, r.concept, r.price, r.foreignPrice, r.discount,
			i.category, i.size, i.stems, i.inkFk,
			i.tag5, i.value5, i.tag6, i.value6, i.tag7, i.value7,
			i.image, im.updated
		FROM myTicketRow r
			JOIN vn.item i ON i.id = r.itemFk
			LEFT JOIN image im
				ON im.collectionFk = 'catalog'
				AND im.name = i.image
		WHERE r.ticketFk = vSelf
		ORDER BY r.concept;
END$$
DELIMITER ;
