Open main menu

Programmer:Stock Status Report

References of AutoCount Accounting version 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

Get all tables in the DataSet of Stock Status

public DataSet GetStockStatusDataSet(BCE.Data.DBSetting dbSetting)
{
    BCE.AutoCount.Stock.StockStatus.StockStatusHelper ssHelper = new BCE.AutoCount.Stock.StockStatus.StockStatusHelper(dbSetting);

    //No filter, warning without filter will load all data

    ssHelper.Inquire();

    return ssHelper.ResultDataSet;
}
  • The DataSet consists of 3 tables, below are the table names:
    1. Master - Contains basic data of item
    2. Detail - Stock Status of the item
    3. SubDetail - Documents for reference

Get the Table of Stock Status with filter

public DataTable GetStockStatusTable(BCE.Data.DBSetting dbSetting)
{
    BCE.AutoCount.Stock.StockStatus.StockStatusHelper ssHelper = new BCE.AutoCount.Stock.StockStatus.StockStatusHelper(dbSetting);

    //Filter Stock Location
    BCE.AutoCount.Stock.StockStatus.StockStatusCriteria crit = ssHelper.Criteria;
    crit.LocationFilter.Type = BCE.AutoCount.SearchFilter.FilterType.ByRange;
    crit.LocationFilter.From = "HQ";
    crit.LocationFilter.To = "HQ";

    ssHelper.Inquire();

    return ssHelper.ResultDataSet.Tables["Detail"];
}


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(BCE.Data.DBSetting dbSetting)
{
    BCE.AutoCount.Stock.StockStatus.StockStatusHelper ssHelper = new BCE.AutoCount.Stock.StockStatus.StockStatusHelper(dbSetting);

    //Filter Stock Location
    BCE.AutoCount.Stock.StockStatus.StockStatusCriteria crit = ssHelper.Criteria;
    crit.LocationFilter.Type = BCE.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

See Also Report API

Category Reporting
AR
AP
Stock
Sales
Purchase

Go to menu