Relation between custinvoiceTrans and GeneralJournalAccountEntry

Hi,

I know there are a lot of similar questions, but unfortunately, none of them answers my problem. For VendInvoiceTrans you can go to InventTransPosting, where the LedgerDimension and DefaultDimension resides in one table, and you can use ledgerDimension to find all GeneralJournalAccountEntry record for that specific voucher.

InventTransPosting = InventTransPosting::find(InventTrans::findTransId(vendInvoiceTrans.InventTransId).DateStatus,
vendInvoiceJour.CostLedgerVoucher,
InventTransOrigin::findByInventTransId(vendInvoiceTrans.inventTransId).RecId,
InventTransPostingType::Financial);

LedgerDimension = InventTransPosting.LedgerDimension;
select generalJournalAccountEntry
where generalJournalAccountEntry.GeneralJournalEntry == SubledgerVoucherGeneralJournalEntry.GeneralJournalEntry
&& generalJournalAccountEntry.LedgerDimension == LedgerDimension
&& (generalJournalAccountEntry.PostingType == WHATEVERPOSTINGTYPE!);

Or, you can use the accountingDistribution framework alongwith SubledgerJournalAccountEntry to find the generalJournalAccountEntry for the specific VendInvoiceTrans.SOURCEDocumentLine

select accountingDistribution
where accountingDistribution.SourceDocumentLine == vendInvoiceTrans.SourceDocumentLine
join subledgerJournalAccountEntryDistribution
where subledgerJournalAccountEntryDistribution.AccountingDistribution == AccountingDistribution.RecId
join GeneralJournalAccountEntry,PostingType
from SubledgerJournalAccountEntry
where SubledgerJournalAccountEntry.RecId == SubledgerJournalAccountEntryDistribution.SubledgerJournalAccountEntry
&& SubledgerJournalAccountEntry.GeneralJournalAccountEntry
&& (SubledgerJournalAccountEntry.PostingType == WHATEVERYOUWANT);

What I am interested is in finding something similar for CustInvoiceTrans. Is there

  1. any table (like InventTransPosting for VendInvoiceTrans), that keeps a track of posted invoiceTransactions with its defaultdimensions or ledgerDimensions. The CustInvoiceTrans.LedgerDimension only shows the main account, but I need some tables where the ledger dimension field would have more information.

or,

  1. any table (like SubledgerJournalAccountEntryDistribution), that keeps a track of generalJournalAccountEntry and sourceDocumentLine.

You can follow the sequence as below

CustInvoiceTrans → CustInvoiceJour → GeneralJournalEntry → GeneralJournalAccountEntry

You can find DefaultDimension in CustInvoiceTrans & CustInvoiceJour where as LedgerDimension can be found in GeneralJournalAccountEntry.

Hope it helps.