2016-07-10 73 views
0

我知道有很多類似的問題,但不幸的是,他們都沒有回答我的問題。對於VendInvoiceTrans,您可以轉到InventTransPosting,其中LedgerDimension和DefaultDimension駐留在一個表中,並且您可以使用ledgerDimension查找該特定憑證的所有GeneralJournalAccountEntry記錄。custinvoiceTrans和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找到generalJournalAccountEntry針對特定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); 

我所感興趣的是在尋找CustInvoiceTrans類似的東西。有沒有

1)任何表(像InventTransPosting爲VendInvoiceTrans),用於保存已發佈的invoiceTransactions及其默認維度或ledgerDimensions的跟蹤。 CustInvoiceTrans.LedgerDimension只顯示主帳戶,但我需要一些表,其中分類帳維度字段將有更多信息。

,或者

2)的任何表(如SubledgerJournalAccountEntryDistribution),即保持generalJournalAccountEntry和sourceDocumentLine的軌跡。

回答

3

InventTransPosting僅保留庫存交易。只有部分Vend和Cust交易由庫存過帳確定。 獲得所需內容的最佳方式是查看錶單LedgerTransVoucher,並通過單擊憑證按鈕查看如何在調用表單CustTrans時對其進行初始化。 在你的情況下,你需要使用SubledgerVoucherGeneralJournalEntry並通過你的CustTrans的憑證和TransDate進行過濾。然後你可以加入這個來獲得所有的分類賬。