SET @from_date= '2022-02-22';
SELECT
	items.item_name,
	item_sub_category.sub_category_name,
	items.indv_item_qty,
	items.pack_size,
	get_item_stock(items.id, 'X', 'LS', @from_date) as loose_stock,
	get_item_stock(items.id, 'X', 'S',@from_date) as whole_stock

FROM 
	items
	
LEFT JOIN 
	item_sub_category 
	ON item_sub_category.id=items.item_sub_category
	
WHERE
	(get_item_stock(items.id, 'X', 'LS', @from_date)+get_item_stock(items.id, 'X', 'S',@from_date))>0 
	AND
	items.is_active='Y'