Programmer:Get Stock Cost v2

From AutoCount Resource Center
Jump to navigation Jump to search

References of AutoCount Accounting version 2.0

AutoCount.Accounting.dll
AutoCount.Accounting.UI.dll
AutoCount.dll
AutoCount.MainEntry.dll
AutoCount.UI.dll
AutoCount.StockMaint.dll
AutoCount.Stock.dll

Standard Cost

Get Standard Cost with ItemRecord

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

Get Standard Cost with StockHelper

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

Most Recent Cost

  • BatchNo can be assigned as null, if there is no BatchNo
public decimal GetRecentStockCost(AutoCount.Data.DBSetting dbSetting, string itemCode, string uom, string loc, string batchNo)
{
    AutoCount.Stock.UTDCostHelper costHelper =
        AutoCount.Stock.UTDCostHelper.Create(dbSetting, itemCode, uom, loc, batchNo, DateTime.Today.Date);

    //BatchNo can be assigned as null, if there is no BatchNo
    //AutoCount.Stock.UTDCostHelper costHelper =
    //    AutoCount.Stock.UTDCostHelper.Create(dbSetting, itemCode, uom, loc, null, DateTime.Today.Date);
    return costHelper.GetMostRecentlyCost().Cost;
}


Up-to-date Cost

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


Items' Stock Balance, Quantity and Costing Table

public System.Data.DataTable GetStockBalanceCostTable(AutoCount.Authentication.UserSession userSession)
{
    AutoCount.Stock.StockBalance.StockBalanceHelper sbHelper = new AutoCount.Stock.StockBalance.StockBalanceHelper(userSession);
    sbHelper.Inquire(DateTime.Today.Date);

    return sbHelper.ResultTable;
}
Stock Balance Table with Quantity and Cost Balance (Ref of version 1.8 / 1.9)








See Also

See Also Report API

Category Reporting
AR
AP
Stock
Sales
Purchase

Go to menu

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