/// <summary>
/// Adds lines of opening balances as current balance to include in summary report.
/// </summary>
protected void addOpenBalToInvtStockCardTmpLineSummary()
{
QueryRun queryRun;
InventValueReportUnionAll inventValueReportUnionAll;
InventTable inventTable;
InventDim inventDim;
InventTrans inventTrans;
InventModelGroup inventModelGroup;
InventTableModule inventTableModule;
//
// Openning balance
//
queryRun = new QueryRun(this.getContract().buildDetailQueryForOpeningBalance());
while (queryRun.next())
{
inventValueReportUnionAll = queryRun.get(tableNum(InventValueReportUnionAll));
inventTrans = queryRun.get(tableNum(InventTrans));
inventDim = queryRun.get(tableNum(InventDim));
inventTable = queryRun.get(tableNum(InventTable));
inventModelGroup = queryRun.get(tableNum(InventModelGroup));
inventTableModule = queryRun.get(tableNum(InventTableModule));
inventStockCardTmpLine.clear();
inventStockCardTmpLine.LineType = InventValueReportLineType::CurrentBalance;
inventStockCardTmpLine.BalanceAmount = inventValueReportUnionAll.Amount;
inventStockCardTmpLine.BalanceQty = inventValueReportUnionAll.Qty;
inventStockCardTmpLine.ItemName = inventTable.itemName();
inventStockCardTmpLine.ItemId = inventValueReportUnionAll.ItemId;
inventStockCardTmpLine.SiteId = inventDim.InventSiteId;
inventStockCardTmpLine.LocationId = inventDim.InventLocationId;
inventStockCardTmpLine.WmsLocationId = inventDim.wmsLocationId;
inventStockCardTmpLine.InventModel = inventModelGroup.InventModel;
inventStockCardTmpLine.UnitId = inventTableModule.UnitId;
if (this.getContract().parmGroupByItemGroup())
{
inventStockCardTmpLine.ItemGroupId = InventTable::find(inventValueReportUnionAll.ItemId).itemGroupId();
}
inventStockCardTmpLine.insert();
}
}
*This post is locked for comments