private CostPrice getAverageCost(RetailStoreId _storeId, ItemId _itemdId)
{
InventDim inventDim;
InventDimParm inventDimParm;
InventOnHand inventOnHand;
;
inventDim.InventLocationId = _storeId;
inventDim.InventSiteId = _storeId;
inventDim = InventDim::findOrCreate(inventDim);
inventDimParm.initFromInventDim(inventDim);
inventOnHand = InventOnHand::newItemDim(_itemdId, inventDim, inventDimParm);
return inventOnHand.costPricePcs();
}
This is the same cost that you see on On-hand form for an item (Cost price field at the bottom), for a particular warehouse. For weighted average model group, cost price = Financial cost amount / Posted qty.
No comments:
Post a Comment