Difference between revisions of "Programmer:Get Stock Cost"

From AutoCount Resource Center
Jump to navigation Jump to search
(Created page with " ==Standard Cost== ===Get Standard Cost with ItemRecord=== <syntaxhighlight lang="csharp"> public decimal GetItemStandardCostWithItemRecord(BCE.Data.DBSetting dbSetting, strin...")
 
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
  +
==References of AutoCount Accounting version 1.8 / 1.9==
  +
{{BaseReferenceAC18}}
  +
'''BCE.AutoCount.StockMaint.dll'''
  +
'''BCE.AutoCount.Stock.dll'''
   
 
==Standard Cost==
 
==Standard Cost==
Line 20: 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(BCE.Data.DBSetting dbSetting, string itemCode, string uom, string loc)
+
public decimal GetRecentStockCost(BCE.Data.DBSetting dbSetting, string itemCode, string uom, string loc, string batchNo)
 
{
 
{
 
BCE.AutoCount.Stock.UTDCostHelper costHelper =
 
BCE.AutoCount.Stock.UTDCostHelper costHelper =
BCE.AutoCount.Stock.UTDCostHelper.Create(dbSetting, itemCode, uom, loc, null, DateTime.Today.Date);
+
BCE.AutoCount.Stock.UTDCostHelper.Create(dbSetting, itemCode, uom, loc, batchNo, DateTime.Today.Date);
 
return costHelper.GetMostRecentlyCost().Cost;
 
return costHelper.GetMostRecentlyCost().Cost;
 
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>
   
  +
<br/>
 
==Up-to-date Cost==
 
==Up-to-date Cost==
 
<syntaxhighlight lang="csharp">
 
<syntaxhighlight lang="csharp">
Line 39: Line 45:
   
 
<br/>
 
<br/>
  +
==Items' Stock Balance, Quantity and Costing Table==
  +
<syntaxhighlight lang="csharp">
  +
public System.Data.DataTable GetStockBalanceCostTable(BCE.Data.DBSetting dbSetting)
  +
{
  +
BCE.AutoCount.Stock.StockBalance.StockBalanceHelper sbHelper = new BCE.AutoCount.Stock.StockBalance.StockBalanceHelper(dbSetting);
  +
sbHelper.Inquire(DateTime.Today.Date);
  +
  +
return sbHelper.ResultTable;
  +
}
  +
</syntaxhighlight>
  +
[[File:Prog StkBalwQtyCost.png|left|1200px|thumb|Stock Balance Table with Quantity and Cost Balance]]<br/>
  +
  +
<br/><br/><br/><br/><br/><br/>
  +
{{SeeAlsoStock}}
  +
{{SeeAlsoAPIReport}}
 
[[Category:Programmer]]
 
[[Category:Programmer]]
 
[[Category:API]]
 
[[Category:API]]

Latest revision as of 10:07, 15 January 2019

References of AutoCount Accounting version 1.8 / 1.9

BCE.AutoCount.dll
BCE.AutoCount.CommonAccounting.dll
BCE.AutoCount.MainEntry.dll
BCE.Utils.dll
BCE.Utils.UI.dll
BCE.AutoCount.StockMaint.dll
BCE.AutoCount.Stock.dll

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

  • BatchNo can be assigned as null, if there is no BatchNo
public decimal GetRecentStockCost(BCE.Data.DBSetting dbSetting, string itemCode, string uom, string loc, string batchNo)
{
    BCE.AutoCount.Stock.UTDCostHelper costHelper =
        BCE.AutoCount.Stock.UTDCostHelper.Create(dbSetting, itemCode, uom, loc, batchNo, 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);
}


Items' Stock Balance, Quantity and Costing Table

public System.Data.DataTable GetStockBalanceCostTable(BCE.Data.DBSetting dbSetting)
{
    BCE.AutoCount.Stock.StockBalance.StockBalanceHelper sbHelper = new BCE.AutoCount.Stock.StockBalance.StockBalanceHelper(dbSetting);
    sbHelper.Inquire(DateTime.Today.Date);

    return sbHelper.ResultTable;
}
Stock Balance Table with Quantity and Cost Balance







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