-- server atl2cfanpv001
use JATesting
go

-- config enum: 100023
select top 10 * from tbConfigurationSetting s with(nolock)
where name like '%cost change tol%'

-- get some test products
select top 10 * from tbItem with(nolock)
where Description like '%sand%'

-- check the entity item price, nb: InventoryUnitCost = DisplayUnitCost / 1500
select InventoryUnitCost, DisplayCost = InventoryUnitCost * 1500, *
from tbEntityItem ei with(nolock)
where ItemID = 2665 -- Sleeve, Grilled Chkn Sandwich(11081)
and EntityID in (271) -- 271: college mall 


-- check with zero starting point that there is no tolerance message
-- > Inventory item
update tbEntityItem
Set InventoryUnitCost = 0
where ItemID = 2665 -- Sleeve, Grilled Chkn Sandwich(11081)
and EntityID = 271 -- 271: college mall 


-- BOM
-- check with zero starting point that there is no tolerance message
-- > Recipe item
update tbEntityItem
Set InventoryUnitCost = 0 -- 1.07
where ItemID = 489 -- Chicken Salad Sandwich (262)
and EntityID = 271 -- 271: college mall 


select InventoryUnitCost, DisplayCost = InventoryUnitCost * 1500, * from tbEntityItem ei with(nolock)
where ItemID = 489 -- Chicken Salad Sandwich (262)
and EntityID in (271) -- 271: college mall 


