LedgerJournalTrans LedgerJournalTrans;
LedgerJournalTable LedgerJournalTable;
TmpLedgerBase tmpLedgerBase;
originalDocuments originalDocuments;
VendInvoiceJour VendInvoiceJour;
VendTrans VendTrans;
select VendTrans where VendTrans.RecId == 68719573210;
Info(strFmt("%1", VendTrans.Invoice));
originalDocuments = new Originaldocuments(VendTrans);
originaldocuments.findRelations();
tmpLedgerBase.setTmpData(originalDocuments.relations());
while select tmpLedgerBase
{
Info(strFmt("%1", tmpLedgerBase.OriginalDocument));
if(tmpLedgerBase.OriginalDocument == OriginalDocument::Purchase)
Info(strFmt("%1", tmpLedgerBase.id));
}
select LedgerJournalTrans where LedgerJournalTrans.VendTransId == 68719573210;
//originalDocuments = new Originaldocuments(LedgerJournalTrans);
//originaldocuments.findRelations();
//tmpLedgerBase.setTmpData(originalDocuments.relations());
//while select tmpLedgerBase
//{
// Info(strFmt("%1", tmpLedgerBase.id));
//}
select VendInvoiceJour
where VendInvoiceJour.ledgerVoucher == VendTrans.Voucher
&& VendInvoiceJour.InvoiceAccount == VendTrans.AccountNum
&& VendInvoiceJour.InvoiceDate == VendTrans.TransDate;
Info(strFmt("%1", VendInvoiceJour.PurchId));
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter