我正在处理显示总帐的SSRS自定义报告,并且需要在报告中显示帐户和子帐户以及供应商或客户的所有交易,例如,如果交易来自采购订单,那么我需要显示供应商,如果来自销售订单,那么我需要向客户展示。
我知道采购订单与GeneralGournalAccountEntry
之间的关系,但我需要GeneralGournalAccountEntry之间的关系来显示客户。
答案 0 :(得分:0)
要知道它是否来自销售订单,请在JournalCategory
表格中选中GeneralJournalEntry
,其值为销售。
了解客户我留下此代码:
static void stackoverflow(Args _args)
{
GeneralJournalAccountEntry GeneralJournalAccountEntry;
GeneralJournalEntry GeneralJournalEntry;
CustInvoiceJour CustInvoiceJour;
CustTable CustTable;
;
select * from GeneralJournalAccountEntry where GeneralJournalAccountEntry.RecId == 88888888 //Your GeneralJournalAccountEntry recId
join GeneralJournalEntry where GeneralJournalEntry.RecId == GeneralJournalAccountEntry.GeneralJournalEntry &&
GeneralJournalEntry.JournalCategory == LedgerTransType::Sales //Sales Order
join CustInvoiceJour where CustInvoiceJour.LedgerVoucher == GeneralJournalEntry.SubledgerVoucher
join CustTable where CustTable.AccountNum == CustInvoiceJour.InvoiceAccount;
info(CustTable.AccountNum);
}