总帐报告

时间:2014-05-28 10:33:57

标签: axapta dynamics-ax-2012 ax dynamics-ax-2012-r2

我正在处理显示总帐的SSRS自定义报告,并且需要在报告中显示帐户和子帐户以及供应商或客户的所有交易,例如,如果交易来自采购订单,那么我需要显示供应商,如果来自销售订单,那么我需要向客户展示。

我知道采购订单与GeneralGournalAccountEntry之间的关系,但我需要GeneralGournalAccountEntry之间的关系来显示客户。

1 个答案:

答案 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);
}