Programmer:Stock Adjustment v2
Technical Specification
- Positive quantity value is to increase stock, and must provide UnitCost.
- Negative quantity value is to decrease stock, and UnitCost value is for reference only.
- Deducted quantity cost is determined in the system costing calculation.
References of AutoCount Accounting version 2.0
AutoCount.Accounting.dll AutoCount.Accounting.UI.dll AutoCount.dll AutoCount.MainEntry.dll AutoCount.UI.dll AutoCount.Stock.dll AutoCount.Manufacturing.dll
Simple Create New Stock Adjustment
public void SimpleCreateNewStockAdjustment(AutoCount.Authentication.UserSession userSession)
{
AutoCount.Stock.StockAdjustment.StockAdjustmentCommand cmd =
AutoCount.Stock.StockAdjustment.StockAdjustmentCommand.Create(userSession, userSession.DBSetting);
AutoCount.Stock.StockAdjustment.StockAdjustment doc = cmd.AddNew();
AutoCount.Stock.StockAdjustment.StockAdjustmentDetail dtl;
doc.DocDate = DateTime.Today.Date; //get only date
doc.Description = "Adjust Stock Quantity";
doc.RefDocNo = "DD0001";
//Increase Quantity
dtl = doc.AddDetail();
dtl.ItemCode = "ItemA";
dtl.Qty = 2M;
dtl.UnitCost = 10M;
//Decrease Quantity
dtl = doc.AddDetail();
dtl.ItemCode = "ItemB";
dtl.Qty = -1M;
//Note, in AutoCount Accounting system, when reduce qty of an item,
//the cost is calculated automatically.
//Even if UnitCost is assigned, the amount if for reference only.
try
{
doc.Save();
//log success
}
catch (AutoCount.AppException ex)
{
//log error
}
}
Edit Stock Adjustment
public void EditStockAdjustment(AutoCount.Authentication.UserSession userSession)
{
string docNo = "ADJ-000001";
AutoCount.Stock.StockAdjustment.StockAdjustmentCommand cmd =
AutoCount.Stock.StockAdjustment.StockAdjustmentCommand.Create(userSession, userSession.DBSetting);
AutoCount.Stock.StockAdjustment.StockAdjustment doc = cmd.Edit(docNo);
AutoCount.Stock.StockAdjustment.StockAdjustmentDetail dtl;
if (doc == null)
{
//log stock adjustment not found
return;
}
doc.ClearDetails();
doc.DocDate = DateTime.Today.Date; //get only date
doc.Description = "Adjust Stock Quantity";
doc.RefDocNo = "DD0001";
//Increase Quantity
dtl = doc.AddDetail();
dtl.ItemCode = "ItemA";
dtl.Qty = 3M;
dtl.UnitCost = 11M;
//Decrease Quantity
dtl = doc.AddDetail();
dtl.ItemCode = "ItemB";
dtl.Qty = -1M;
try
{
doc.Save();
//log success
}
catch (AutoCount.AppException ex)
{
//log error
}
}
Cancel Stock Adjustment
public void CancelStockAdjustment(AutoCount.Authentication.UserSession userSession)
{
string docNo = "ADJ-000001";
AutoCount.Stock.StockAdjustment.StockAdjustmentCommand cmd =
AutoCount.Stock.StockAdjustment.StockAdjustmentCommand.Create(userSession, userSession.DBSetting);
try
{
if (cmd.CancelDocument(docNo))
{
//log success
}
else
{
//log failed
}
}
catch (AutoCount.AppException ex)
{
//log error
}
}
Delete Stock Adjustment
public void DeleteStockAdjustment(AutoCount.Authentication.UserSession userSession)
{
string docNo = "ADJ-000001";
AutoCount.Stock.StockAdjustment.StockAdjustmentCommand cmd =
AutoCount.Stock.StockAdjustment.StockAdjustmentCommand.Create(userSession, userSession.DBSetting);
try
{
cmd.Delete(docNo);
//log success
}
catch (AutoCount.AppException ex)
{
//log error
}
}
See Also
- Item Group v2
- Stock Item (Item Maintenance) v2
- Item Package v2
- Stock Adjustment v2
- Stock Transfer v2
- Stock Assembly v2
- Get Stock Cost and Stock Balance with Costing - [1.8, 1.9] [2.0]
- Item Opening Balance Maintenance - [1.8, 1.9] [2.0]
Go to top
|
Resources For AutoCount Software Developers
|