Dynamics ax 2012 get real std cost

get real std cost

public static server InventItemPrice TEK_find(
    ItemId                  _itemId,
    InventSiteId            _InventSiteId   = "",
    boolean                 _forUpdate      = false,
    // #! for TEK_ProdSTDvsActCost report 
    date                    _date           = today()
    )
{
    InventItemPrice     inventItemPrice;
    InventDim           InventDim;
    if (_InventSiteId)
    {
        select firstonly inventItemPrice
            order by ActivationDate desc, CreatedDateTime desc
            where inventItemPrice.ItemId                == _itemId
                && inventItemPrice.PriceType            == CostingVersionPriceType::Cost
                && inventItemPrice.ActivationDate       <= _date
            join InventDim
                where InventDim.inventDimId == inventItemPrice.InventDimId
                    && InventDim.InventSiteId == _InventSiteId;
    }    else
    {        select firstonly inventItemPrice
            order by ActivationDate desc, CreatedDateTime desc
            where inventItemPrice.ItemId                == _itemId
                && inventItemPrice.PriceType            == CostingVersionPriceType::Cost
                && inventItemPrice.ActivationDate       <= _date
                ;
    }    return inventItemPrice;
}


    Danzel
    Danzel管理员

    • 声明:本文由Danzel于2020-05-13转载(优化),转载须经原站同意并注明出处。
    • 本文地址:http://maryd.cn/?id=9
    上一篇:Linux 常用命令--持续更新
    下一篇:Dynamics AX Split a string with fixed separators List

    留言评论

    暂无留言
    取消
    扫码支持