Monday, January 16, 2017

Get Lastest Purchase price of an item ax 2012

private Price GetLatestPurchPrice(ItemId _item)

{
    InventItemPrice invItemprice;
    ;
    select firstOnly invItemprice order by RecId desc
        where invItemprice.ItemId == _item
            && invItemprice.PriceType == CostingVersionPriceType::Purch
                && invItemprice.CostingType == InventItemCostingType::Last;
   
    return  invItemprice.Price;
}

No comments:

Post a Comment