AX 开发6

Ledger相关资料

There are two methods to consider when posting transactions to the ledger:
1.  Use the LedgerVoucher class and sub-classes, which is the more
     direct and controllable route.
2.  Use a journal which is more straightforward to use.

 

When using LedgerVoucher, remember that all vouchers in Microsoft Dynamics AX 2009 must balance - an equal credit and debit side

All transactions on one voucher must be posted on the same date. The idea is to build up a list of vouchers to be posted and to build up a list of transactions within each voucher. Once these lists are completed, the system posts them all to the General Ledger module at once.

1,创建 list<voucher>

2,对list中的每一个voucher,创建一个对应list<transactions >

3,创建好上面的两个list,系统就执行过账的动作

 

具体过账如下:

LedgerVoucher,harnesses the posting of multiple vouchers at one time,它检查posting是否正确,以及voucher是否balances;

The LedgerVoucher class holds all the vouchers in temporary storage (a list array) until the End method is called. The End method creates ledger transaction records from the temporary postings.

上面意思:

1,LedgerVoucher class 拥有 a list of voucher

2,LedgerVoucher 的end方法,从list 创建ledger transaction 记录

Each voucher in the LedgerVoucher is contained in a LedgerVoucherObject. Each LedgerVoucherObject holds transactions in temporary storage (a list array) until the end() method is called. Each transaction in each voucher is contained in a LedgerVoucherTransObject.

上面意思:

1,LedgerVoucher 拥有LedgerVoucherObject,LedgerVoucher 中的每一个voucher,实际是 被包含在LedgerVoucherObject中

2,LedgerVoucherObject 拥有a list transactions

3,LedgerVoucherTransObject代表 每一个voucher中的transaction list

总结:

1.  Instantiate the LedgerVoucher class. 

2.  Loop over the vouchers to instantiate LedgerVoucherObject classes, and register these in the LedgerVoucher class. 
3.  For each voucher, loop over the transactions to instantiate LedgerVoucherTransObject classes, and register these in the LedgerVoucher class.

首先实例化LedgerVoucher ,然后循环LedgerVoucher 中的voucher,实例化LedgerVoucherObject 同时将其注册到LedgerVoucher 中(每一个LedgerVoucherObject对应一个vourcher ),最后循环每一个voucher中的transactions ,实例化LedgerVoucherTransObject ,同时将其注册到LedgerVoucher 中

posted @ 2012-09-11 14:20  MicroAx  阅读(228)  评论(0编辑  收藏  举报