Programmer:Get Stock Cost v2: Difference between revisions

From AutoCount Resource Center
Content added Content deleted
(Created page with "==References of AutoCount Accounting version 2.0== {{BaseReferenceAC20}} '''AutoCount.StockMaint.dll''' '''AutoCount.Stock.dll''' ==Standard Cost== ===Get Standard Cost wit...")
 
Line 24: Line 24:


==Most Recent Cost==
==Most Recent Cost==
*BatchNo can be assigned as null, if there is no BatchNo
<syntaxhighlight lang="csharp">
<syntaxhighlight lang="csharp">
public decimal GetRecentStockCost(AutoCount.Data.DBSetting dbSetting, string itemCode, string uom, string loc)
public decimal GetRecentStockCost(AutoCount.Data.DBSetting dbSetting, string itemCode, string uom, string loc, string batchNo)
{
{
AutoCount.Stock.UTDCostHelper costHelper =
AutoCount.Stock.UTDCostHelper costHelper =
AutoCount.Stock.UTDCostHelper.Create(dbSetting, itemCode, uom, loc, null, DateTime.Today.Date);
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;
return costHelper.GetMostRecentlyCost().Cost;
}
}
Line 34: Line 39:


<br/>
<br/>

==Up-to-date Cost==
==Up-to-date Cost==
<syntaxhighlight lang="csharp">
<syntaxhighlight lang="csharp">

Revision as of 07:37, 21 August 2018

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

Go to menu

Go to top
Resources For AutoCount Software Developers