0

Report for Items not Counted


C
Chris Muench

Need an omnibus report that for a particular vendor and given a date will show all items with quantity that have not been scanned in an Item Count (inventory) from the date given excluding anything received.

Sql for similar is:
Select it.product_id, it.item_number, it.name, it.size, c.name as category, li.quantity, li.item_id from pointofsale_51.phppos_items it
join pointofsale_51.phppos_location_items li on it.item_id = li.item_id
join pointofsale_51.phppos_categories c on c.id = it.category_id
where
li.quantity > 0
and li.location_id = 2
and it.product_id is not null


and it.item_id not in (

SELECT item_id FROM pointofsale_51.phppos_inventory_counts_items c
JOIN pointofsale_51.phppos_inventory_counts ic on c.inventory_counts_id = ic.id
where ic.count_date >= '2021-08-16'
)
and
it.item_id not in (
SELECT item_id FROM pointofsale_51.phppos_receivings_items
where receiving_id in
(SELECT receiving_id FROM pointofsale_51.phppos_receivings where receiving_time >= '2021-08-16' and location_id =2)
)

A