Programmer:Stock Status Report 2: Difference between revisions
Content added Content deleted
(Created page with "==References of AutoCount Accounting version 2.1== *nuget package "AutoCount2.Stock" AutoCount.dll AutoCount.Accounting.dll AutoCount.UI.dll AutoCount.Images.dll AutoCount.Accounting.UI.dll AutoCount.Inquiry.dll AutoCount.Invoicing.dll '''AutoCount.Stock.dll''' ==Get all tables in the DataSet of Stock Status== <syntaxhighlight lang="csharp"> public DataSet GetStockStatusDataSet(AutoCount.Authentication.UserSession userSession) { AutoCount.Stock.StockStatus...") |
No edit summary |
||
Line 38: | Line 38: | ||
public DataTable GetStockStatusTable(AutoCount.Authentication.UserSession userSession) |
public DataTable GetStockStatusTable(AutoCount.Authentication.UserSession userSession) |
||
{ |
{ |
||
AutoCount.Stock.StockStatus.StockStatusHelper ssHelper = new AutoCount.Stock.StockStatus.StockStatusHelper( |
AutoCount.Stock.StockStatus.StockStatusHelper ssHelper = new AutoCount.Stock.StockStatus.StockStatusHelper(userSession); |
||
//Filter Stock Location |
//Filter Stock Location |
||
Line 56: | Line 56: | ||
This example shows how to add a column "ReadyStock" and calculate the value using two existing values. |
This example shows how to add a column "ReadyStock" and calculate the value using two existing values. |
||
<syntaxhighlight lang="csharp"> |
<syntaxhighlight lang="csharp"> |
||
public DataTable GetStockStatusTableWithColumnExpression( |
public DataTable GetStockStatusTableWithColumnExpression(AutoCount.Authentication.UserSession userSession) |
||
{ |
{ |
||
AutoCount.Stock.StockStatus.StockStatusHelper ssHelper = new AutoCount.Stock.StockStatus.StockStatusHelper(myUserSession); |
|||
//Filter Stock Location |
//Filter Stock Location |
||
AutoCount.Stock.StockStatus.StockStatusCriteria crit = ssHelper.Criteria; |
AutoCount.Stock.StockStatus.StockStatusCriteria crit = ssHelper.Criteria; |
||
crit.LocationFilter.Type = |
crit.LocationFilter.Type = AutoCount.SearchFilter.FilterType.ByIndividual; |
||
crit.LocationFilter.Add("HQ"); |
crit.LocationFilter.Add("HQ"); |
||
ssHelper.Inquire(); |
ssHelper.Inquire(); |
||
Line 76: | Line 75: | ||
} |
} |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
{{SeeAlsoStock}} |
{{SeeAlsoStock}} |
Revision as of 03:13, 31 January 2023
References of AutoCount Accounting version 2.1
- nuget package "AutoCount2.Stock"
AutoCount.dll AutoCount.Accounting.dll AutoCount.UI.dll AutoCount.Images.dll AutoCount.Accounting.UI.dll AutoCount.Inquiry.dll AutoCount.Invoicing.dll AutoCount.Stock.dll
Get all tables in the DataSet of Stock Status
public DataSet GetStockStatusDataSet(AutoCount.Authentication.UserSession userSession)
{
AutoCount.Stock.StockStatus.StockStatusHelper ssHelper = new AutoCount.Stock.StockStatus.StockStatusHelper(myUserSession);
//No filter, warning without filter will load all data
ssHelper.Inquire();
return ssHelper.ResultDataSet;
}
- The DataSet has 3 tables, below are the table names:
- Master - Contains basic data of item
- Detail - Stock Status of the item
- SubDetail - Documents for reference
Get the Table of Stock Status with filter
public DataTable GetStockStatusTable(AutoCount.Authentication.UserSession userSession)
{
AutoCount.Stock.StockStatus.StockStatusHelper ssHelper = new AutoCount.Stock.StockStatus.StockStatusHelper(userSession);
//Filter Stock Location
AutoCount.Stock.StockStatus.StockStatusCriteria crit = ssHelper.Criteria;
crit.LocationFilter.Type = AutoCount.SearchFilter.FilterType.ByRange;
crit.LocationFilter.From = locationFrom;
crit.LocationFilter.To = locationTo;
ssHelper.Inquire();
DataTable tblResult = ssHelper.ResultDataSet.Tables["Detail"];
return tblResult;
}
Add a column of expression to stock status table
This example shows how to add a column "ReadyStock" and calculate the value using two existing values.
public DataTable GetStockStatusTableWithColumnExpression(AutoCount.Authentication.UserSession userSession)
{
AutoCount.Stock.StockStatus.StockStatusHelper ssHelper = new AutoCount.Stock.StockStatus.StockStatusHelper(myUserSession);
//Filter Stock Location
AutoCount.Stock.StockStatus.StockStatusCriteria crit = ssHelper.Criteria;
crit.LocationFilter.Type = AutoCount.SearchFilter.FilterType.ByIndividual;
crit.LocationFilter.Add("HQ");
ssHelper.Inquire();
DataTable dtDtl = ssHelper.ResultDataSet.Tables["Detail"];
if (!dtDtl.Columns.Contains("ReadyStock"))
{
dtDtl.Columns.Add("ReadyStock", typeof(decimal), "OnHandQty - CSGNBalQty");
}
return dtDtl;
}
See Also
- Item Group
- Stock Item (Item Maintenance)
- Stock Adjustment
- Stock Transfer
- Stock Assembly
- Stock Balance with Costing - [1.8, 1.9] [2.0]
- Item Opening Balance Maintenance - [1.8, 1.9] [2.0]
See Also Report API
Category | Reporting | |||
---|---|---|---|---|
AR |
| |||
AP |
| |||
Stock |
| |||
Sales |
| |||
Purchase |
|
Go to top
|
Resources For AutoCount Software Developers
|