public void processReport()
{
ABCVendItemStatisticsNewContract contract = this.parmDataContract() as ABCVendItemStatisticsNewContract;
CurrencyExchangeHelper currencyExchangeHelper = CurrencyExchangeHelper::newLedger(Ledger::current());
currencyExchangeHelper.parmErrorType(AifErrorType::Exception);
fromDate_Period1 = contract.parmPeriodOneFromDate();
toDate_Period1 = contract.parmPeriodOneToDate();
fromDate_Period2 = contract.parmPeriodTwoFromDate();
toDate_Period2 = contract.parmPeriodTwoToDate();
QueryRun queryRun_Current = new QueryRun(this.buildPeriodQuery(this.parmQuery()));
while (queryRun_Current.next())
{
CustInvoiceJour custInvoiceJour_Current = queryRun_Current.get(tablenum(CustInvoiceJour));
CustInvoiceTrans custInvoiceTrans_Current = queryRun_Current.get(tablenum(CustInvoiceTrans));
ItemId currentCustInvoiceTransItemId = this.parmCustInvoiceTransItemId(custInvoiceTrans_Current);
boolean itemNEqPrev = itemId != currentCustInvoiceTransItemId;
boolean accNEqPrev = orderAccount != custInvoiceJour_Current.OrderAccount;
periodNum = ItemReportPeriodNum::Both;
if (accNEqPrev || itemNEqPrev)
{
this.insertIntoTmpTable();
if (itemNEqPrev)
{
salesUnit = InventTableModule::find(currentCustInvoiceTransItemId,ModuleInventPurchSales::Sales).UnitId;
}
orderAccount = custInvoiceJour_Current.OrderAccount;
itemId = currentCustInvoiceTransItemId;
vendAccount = InventTable::find(itemid).PrimaryVendorId;
}
this.definePeriod(custInvoiceTrans_Current.InvoiceDate);