Hey André,
Thank you so much for your speedy response. I guess I'm just confused as to how the aging data is displayed on the CustVendAgingStatistics form. The code seems to be clearing the tmp table after the code goes through each aging period. I'm seeing the data inserted into tmp table in the base code CustVendAgingStatistics.calcStatistic() :
void calcStatistic()
{
StatRepIntervalLine statRepIntervalLine;
StatRepInterval statRepInterval;
int i;
QueryRun queryRun;
Query query = new Query();
QueryBuildDataSource qbds;
TmpStatPer tmpStat;
delete_from tmpAccountSum;
qbds = query.addDataSource(tablenum(TmpStatPer));
statRepInterval = StatRepInterval::find(defName);
switch (statRepInterval.PrintDirection)
{
case ForwardBackwardPrinting::Forward:
qbds.addSortField(fieldnum(TmpStatPer, LineNum), SortOrder::Ascending);
break;
case ForwardBackwardPrinting::Backward:
qbds.addSortField(fieldnum(TmpStatPer, LineNum), SortOrder::Descending);
break;
}
queryRun = new QueryRun(query);
queryRun.setCursor(tmpStatPer);
i = 0;
while (queryRun.next())
{
tmpStat = queryRun.getNo(1);
select Heading, LineNum from statRepIntervalLine
where statRepIntervalLine.LineNum == tmpStat.LineNum
&& statRepIntervalLine.Name == defName;
i++;
tmpAccountSum.clear();
tmpAccountSum.AccountNum = custVendTable.AccountNum;
tmpAccountSum.TransDate = tmpStatPer.StartDate;
tmpAccountSum.SortDate = tmpStatPer.EndDate;
tmpAccountSum.Txt = statRepIntervalLine.Heading;
tmpAccountSum.Balance01 = this.calcInvoiceBalanceByDate();
tmpAccountSum.Balance02 = this.calcPaymentBalanceByDate();
tmpAccountSum.Balance03 = this.calcOpenBalanceByDate();
tmpAccountSum.Balance04 = statRepIntervalLine.LineNum;
tmpAccountSum.IsCustAccount = isCustAccount;
tmpAccountSum.insert();
}
this.calcTotals();
}
I would appreciate any extra help in understanding this logic and where the information could be pulled from to populate the CustVendAgingStatistics form. Thank you.