Getting Ledger transactions in Ax 2012

2024-01-13 15:32

本文主要是介绍Getting Ledger transactions in Ax 2012,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!


最近遇到相同的开发需求,找到了这篇文章。

Continuing with my blogs on Chart of accounts, in this blog, I will help you find the ledger transactions between a particular period.

In Ax 2009, it was pretty simple as you had to just loop through LedgerTrans table, Ax 2012 it has changed a bit.

Lets take an example and see how we can achieve this. Say you want to display following information in a report (for example purpose we will use infolog, I will cover reports in other blog entries).

Main account number – Main account name, Transaction date, voucher number, amount in base currency, amount in transaction currency and currency code.

To fetch transactions, now there are two tables that we need to use:

GeneralJournalEntry, GeneralJournalAccountEntry (There are more tables with GeneralJournalPrefix, I have not found there use yet but will update this post once I find more use of them).

staticvoid findLedgerTransactions(Args _args)

{

   MainAccount                         mainAccount; //Holds the main accounts

   GeneralJournalEntry                 generalJournalEntry; //Used to hold Ledger transactions

   GeneralJournalAccountEntry          generalJournalAccountEntry;//Used to hold Ledger transactions

   SubledgerJournalEntry               subLedgerJournalEntry; //Used to hold sub Ledger transactions (Like sales/purch invoice etc.)

   SubledgerJournalAccountEntry        subLedgerJournalAccountEntry; //Used to hold sub Ledger transactions (Like sales/purch invoice etc.)

   DimensionAttributeValueCombination  dimAttrValueComb; //Used to store the combination of main accounts and dimensions

 

   whileselect AccountingCurrencyAmount, TransactionCurrencyAmount, TransactionCurrencyCode

           from generalJournalAccountEntry

           join dimAttrValueComb

               wheredimAttrValueComb.RecId == generalJournalAccountEntry.LedgerDimension

           join AccountingDate, JournalNumberfrom generalJournalEntry

               where generalJournalAccountEntry.GeneralJournalEntry ==generalJournalEntry.RecId

                  && generalJournalEntry.AccountingDate == 017\2010

                  && generalJournalEntry.PostingLayer == OperationsTax::Current

                  && generalJournalEntry.Ledger == Ledger::current()

               join MainAccountId, Namefrom mainAccount

                   wheremainAccount.RecId == dimAttrValueComb.MainAccount

                       && mainAccount.MainAccountId == ‘130100’

           join subLedgerJournalAccountEntry

               where subLedgerJournalAccountEntry.GeneralJournalAccountEntry ==generalJournalAccountEntry.RecId

                  && subLedgerJournalAccountEntry.LedgerDimension == generalJournalAccountEntry.LedgerDimension

               join Voucherfrom subLedgerJournalEntry

                   where subLedgerJournalAccountEntry.SubledgerJournalEntry ==subLedgerJournalEntry.RecId

                      //&& subLedgerJournalEntry.Ledger == Ledger::current()

 

   {

       info(strFmt("%1-%2, %3, %4, %5, %6, %7, %8", mainAccount.MainAccountId,mainAccount.Name,

                   generalJournalEntry.AccountingDate, subLedgerJournalEntry.Voucher,

                   generalJournalAccountEntry.TransactionCurrencyCode, generalJournalAccountEntry.TransactionCurrencyAmount,

                   generalJournalAccountEntry.AccountingCurrencyAmount,

                   generalJournalEntry.JournalNumber));

   }

}

 

The output is as follows:

image

image

这篇关于Getting Ledger transactions in Ax 2012的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/601934

相关文章

windows server 2012 R2 安装桌面体验,安装ActiveSync时提示缺少Windows组件

第一步:启动《服务器管理器》 右键桌面上的"计算机",管理,打开服务器管理器 第二步:选择所有服务器,右键显示出来的服务器,添加角色和功能 第三步,在弹出的弹窗,一直点下一步下一步,到功能位置。 注意安装类型:选择“基于角色或基于功能安装” 然后 点击一下步 服务器选择 :操作: 无需配置,选择下一步 服务器角色:操作: 无需配置,选择下一步 功能 操作 选择 “用户界面和基础结构

修复漏洞Windows 2012 Server R2(CVE-2016-2183)、(CVE-2015-2808)、(CVE-2013-2566)

修复漏洞 漏洞风险等级评定标准主机风险等级评定标准漏洞概括利用注册表修复漏洞查看修复后的漏洞 漏洞风险等级评定标准 危险程度危险值区域危险程度说明高7 <=漏洞风险值<= 10攻击者可以远程执行任意命令或者代码,或对系统进行远程拒绝服务攻击。中4 <=漏洞风险值< 7攻击者可以远程创建、修改、删除文件或数据,或对普通服务进行拒绝服务攻击。低0 <=漏洞风险值< 4攻击者可以获取

.NET客户端实现Redis中的管道(PipeLine)与事物(Transactions)(八)

序言 Redis中的管道(PipeLine)特性:简述一下就是,Redis如何从客户端一次发送多个命令,服务端到客户端如何一次性响应多个命令。 Redis使用的是客户端-服务器模型和请求/响应协议的TCP服务器,这就意味着一个请求要有以下步骤才能完成:1、客户端向服务器发送查询命令,然后通常以阻塞的方式等待服务器相应。2、服务器处理查询命令,并将相应发送回客户端。这样便会通过网络连接,如

《咬文嚼字》发布“2012年十…

原文地址:《咬文嚼字》发布“2012年十大流行语”,“正能量”位居榜首 作者: 咬文嚼字 《咬文嚼字》编辑部   1)     正能量  指的是一种健康乐观、积极向上的动力和情感。“正能量”本是物理学名词,霍金《时间简史》中就用过:“宇宙中的物质是由正能量组成的。”“正能量”的流行源于英国心理学家理查德·怀斯曼的专著《Rip it up》(中文译名《正能量》),其中将人体比作一个能

LAMP兄弟连PHP高薪就业班2012召集令

八年畜牧专业(动物科学)学习,养猪实习中决定改变,毕业后入职新浪产品事业部,28期学员侯永伟         从事网络运维工作两年,转行学习PHP ,毕业后即入职知名商企ShopEX,28期学员李本根         自学PHP三年,36岁选择参加培训,毕业后入职知名PHP外包企业互动阳光,31期学员孙健勇         十七岁入学,毕业后即入职,月薪3500元

LAMP兄弟连2012年第一季度PHP培训学费优惠政策

在过去的2011年,承蒙各位学员的信任与兄弟连全体同仁的努力,兄弟连年培训学员近千人,为众多怀揣梦想的年轻人达成所愿,也为众多业 内用人企业输送了大量人才,总算不负PHP第一培训学校的盛名,在即将到来的2012年,兄弟连重装上阵,新版课程发布、乔迁新址、《细说PHP》改版、 《细说Linux》发行、更多视频教程录制……同时,我们也将继续执行学费优惠政策。          凡2012年第一

2012组------我们来啦--兄弟连

在我赶往期待之地的驿站的时候,在那个慵懒而又昏暗的候车厅里,我就在思考着,在这么一个寒冷的夜晚,又有谁会和我有着共同的目的地,又有着怎样的故事呢,一切都是未知,但我知道,在未来之后的几天里,我就能看到这些故事的创造者,或许还会跟我有着共同的故事吧!        十一月的月末,就是这样的日子,我们的团队齐聚一起,东到吉林、北至内蒙、南达成都、最终归于中原。在在延绵万里的大地上,我们占据了祖

【Hadoop】Flume NG Getting Started(Flume NG 新手入门指南)翻译

新手入门 Flume NG是什么? 有什么改变? 获得Flume NG 从源码构建 配置 flume-ng全局选项flume-ng agent选项flume-ng avro-client 选项 提供反馈 Flume NG是什么? Flume NG的目标是比Flume OG在简单性,大小和容易部署上有显著性地提高。为了实现这个目标,Flume NG将不会兼容Flume OG.我们目

SQLServer 2012误操作数据库恢复方法

--BEGIN --第一步:备份数据库(完整版) --第二步:正常操作和误操作 --正常操作 insert into Table_A(Name) values('张三') insert into Table_A(Name) values('李四') insert into Table_A(Name) values('王五') insert into Table_A(Name) val

802.11ax(Wi-Fi 6)技术如何测试?

1. 802.11ax关键技术简介 802.11ax协议(也称Wi-Fi 6,Wi-Fi 5指802.11ac)是为了满足高密度场景下用户速率和体验需求而提出的。类似于3GPP 5G NR中的eMBB应用场景,其目的是提升高密集场景的用户速率,从而获得更好的用户峰值数据体验。2013年3月TG(Task Group)工作组成立,2014年开始研究802.11ax标准,2016年提出802.11a