SELECT
	_VPW.Location AS shelf,
	_VPW.MFG_SKU AS location,
	MAX(pins.Name) AS description,
	MIN(_VPW.TX) AS expected_count,
	'' AS scanned,
	'' AS actual_count,
        MAX(pins.Cost) AS Cost
FROM
	products._VPW
JOIN products.pins
	ON _VPW.MFG_SKU = pins.PIN AND pins.Parent = ''
WHERE
	_VPW.TX != 0
GROUP BY
	_VPW.MFG_SKU, _VPW.Location
ORDER BY
	CASE WHEN _VPW.Location = '' THEN 'Z' ELSE _VPW.Location END,
	CAST(REPLACE(_VPW.MFG_SKU, '-', '') AS UNSIGNED)