final class VendAccountStatementIntDP_Extension
{
private NoYes ExclPrepayments;
{
// Call the base class method
next processReport();
VendAccountStatementIntContract vendAccountStatementIntContract = this.parmDataContract();
// Get the value of the exclusion parameter
ExclPrepayments = vendAccountStatementIntContract.parmExclPrepayment();
// Initialize the query
Query query = this.initVendTransQuery();
}
{
Query query = next initVendTransQuery();
QueryBuildDataSource vendTransDataSourceBase = SysQuery::findOrCreateDataSource(query, tableNum(VendTrans), tableNum(VendTable));
// Add VendInvoiceJour as a child data source of VendTrans
QueryBuildDataSource vendInvoiceJourDataSource = vendTransDataSourceBase.addDataSource(tableNum(VendInvoiceJour));
vendInvoiceJourDataSource.relations(true);
vendInvoiceJourDataSource.joinMode(JoinMode::OuterJoin);
vendInvoiceJourDataSource.addLink(fieldNum(VendInvoiceJour, LedgerVoucher), fieldNum(VendTrans, Voucher));
vendInvoiceJourDataSource.addLink(fieldNum(VendInvoiceJour, InvoiceAccount), fieldNum(VendTrans, AccountNum));
if (ExclPrepayments == NoYes::Yes)
{
vendInvoiceJourDataSource.addRange(fieldNum(VendInvoiceJour, InvoiceType)).value(SysQuery::valueNot(Enum2Str(PurchInvoiceType::VendorAdvance)));
}
}
}