DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelving_get`(IN vSelf VARCHAR(8))
BEGIN
/**
* Lista artículos de itemshelving 
*
* @param vSelf matrícula del carro
**/
	SELECT ish.itemFk item, 
			IFNULL(i.longName, CONCAT(i.name, ' ', i.size)) description, 
			ish.visible,
			CEIL(ish.visible/ish.packing) stickers,
			ish.packing,
			ish.grouping,
			p.code,
			ish.id,
			s.priority,
			ish.isChecked
		FROM itemShelving ish
			JOIN item i ON i.id = ish.itemFk
			JOIN shelving s ON vSelf = s.code COLLATE utf8_unicode_ci
			LEFT JOIN parking p ON s.parkingFk = p.id
		WHERE ish.shelvingFk COLLATE utf8_unicode_ci = vSelf;
END$$
DELIMITER ;
