gemma-l
6/26/2017 - 11:20 AM

excessive tare transactions

excessive tare transactions

--	Excessive Tare Transactions - tare over 100kg
Select  *
from (
select vci.ItemID, vci.ItemTypeCode, vci.Timestamp, vci.Units as QTY, vci.NetWeight, vci.TareWeight, vci.GrossWeight, dfd.Code as [PLU Code], dfd.Text1 as [PLU Description], dt.UserID, su.Username, dt.TransactionType
from vw_ce_ims_items vci
left join datafiles_data dfd on vci.PLUID=dfd.DatafileDataID and Active=1
left join dms_transactions dt on vci.ItemID=dt.UID
left join security_users su on dt.UserID=su.UserID
where 
--Destroyed=0
--and 
TareWeight > 100											-- Enter minimum tare value
and vci.Timestamp between '2016-09-01' and '2016-10-06'			-- Enter Date range
and TransactionType NOT IN ('IMS_ITEM_MOVED',
'BOX_PRODUCTION_RETAIL',
'SCANNING_ERROR',
'BOX_PRODUCTION_RETAIL_CANCEL',
'PALLET_DISPATCH_PICKING',
'PALLET_DISPATCH_LOADING',
'PLU_REGRADE_FW',
'PLU_REGRADE_RW',
'BOX_WRITE_OFF',
'BOX_SUPPLIER_RETURN',
'BOX_REWORK')
) x
where UserID is not null

order by TareWeight desc