custinvoiceTrans 和 GeneralJournalAccountEntry 之间的关系

Relation between custinvoiceTrans and GeneralJournalAccountEntry

我知道有很多类似的问题,但不幸的是,none 回答了我的问题。对于 VendInvoiceTrans,您可以转到 InventTransPosting,其中 LedgerDimension 和 DefaultDimension 位于一个 table,并且您可以使用 ledgerDimension 查找该特定凭证的所有 GeneralJournalAccountEntry 记录。

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!);

或者,您可以使用 accountingDistribution 框架以及 SubledgerJournalAccountEntry 来查找特定 VendInvoiceTrans.SOURCEDocumentLine

的一般 JournalAccountEntry
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);

我感兴趣的是为 CustInvoiceTrans 找到类似的东西。有没有

1) 任何 table(如 VendInvoiceTrans 的 InventTransPosting),它使用默认维度或分类账维度跟踪已发布的发票交易。 CustInvoiceTrans.LedgerDimension 仅显示主帐户,但我需要一些 tables,其中分类帐维度字段将包含更多信息。

或者,

2) 任何 table(如 SubledgerJournalAccountEntryDistribution),跟踪 generalJournalAccountEntry 和 sourceDocumentLine。

InventTransPosting 仅保留库存交易记录。只有部分 Vend 和 Cust 交易由库存过帐创建。 获得所需内容的最佳方法是查看 LedgerTransVoucher 表单,并查看在通过单击 Voucher 按钮调用 form CustTrans 表单时如何初始化它。 在您的情况下,您需要使用 SubledgerVoucherGeneralJournalEntry 并按 CustTrans 的 Voucher 和 TransDate 对其进行过滤。然后你可以加入这个来获取所有的子分类帐过帐。