Programmer:Get Stock Cost

From AutoCount Resource Center
Revision as of 04:03, 9 August 2018 by DanielY (talk | contribs) (Created page with " ==Standard Cost== ===Get Standard Cost with ItemRecord=== <syntaxhighlight lang="csharp"> public decimal GetItemStandardCostWithItemRecord(BCE.Data.DBSetting dbSetting, strin...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Standard Cost

Get Standard Cost with ItemRecord

public decimal GetItemStandardCostWithItemRecord(BCE.Data.DBSetting dbSetting, string itemCode, string uom)
    BCE.AutoCount.Data.ItemRecord itemRec = BCE.AutoCount.Data.CommonRecordUtils.GetItem(dbSetting, itemCode, uom);
    return itemRec == null ? 0 : itemRec.Cost;

Get Standard Cost with StockHelper

public decimal GetItemStandardCostWithStockHelper(BCE.Data.DBSetting dbSetting, string itemCode, string uom)
    BCE.AutoCount.Stock.StockHelper stkHelper = BCE.AutoCount.Stock.StockHelper.Create(dbSetting);
    return stkHelper.GetFixedCost(itemCode, uom);

Most Recent Cost

public decimal GetRecentStockCost(BCE.Data.DBSetting dbSetting, string itemCode, string uom, string loc)
    BCE.AutoCount.Stock.UTDCostHelper costHelper =
        BCE.AutoCount.Stock.UTDCostHelper.Create(dbSetting, itemCode, uom, loc, null, DateTime.Today.Date);
    return costHelper.GetMostRecentlyCost().Cost;

Up-to-date Cost

public decimal GetUpToDateUnitCost(BCE.Data.DBSetting dbSetting, string itemCode, string uom, decimal qty, DateTime date)
    BCE.AutoCount.Stock.StockHelper stkHelper = BCE.AutoCount.Stock.StockHelper.Create(dbSetting);
    return stkHelper.GetUpToDateUnitCost(itemCode, uom, qty, date);

Go to menu

IconAC81.png Go to top
ProgrammerGo.jpg Resources For AutoCount Software Developers