Tuesday, July 6, 2010

Check Journal Balance - When you meet a problem of "do not balance", this break point will be very helpful.

Object:


\Classes\LedgerVoucherObject\updateTotals


Invoke Scenario:

When there is some problem about imbalance, this function will be very helpful to track why it is imbalance.


Operation Instance:



General ledger -> Journals -> General journal -> Create a new line -> Click Line -> add lines for journal -> Click button post -> post.


Explanation of codes:
private void updateTotals(LedgerTrans _ledgerTrans)
{
LedgerTrans ledgerTransTotals;
;
ledgerTransTotals.data(_ledgerTrans);
if (transDateTotals.find(ledgerTransTotals)) //line 13
{

ledgerTransTotals.AmountCur += _ledgerTrans.AmountCur;
ledgerTransTotals.AmountMST += _ledgerTrans.AmountMST; //line 16
ledgerTransTotals.AmountMSTSecond += _ledgerTrans.AmountMSTSecond;
ledgerTransTotals.Qty += _ledgerTrans.Qty;
transDateTotals.ins(ledgerTransTotals, true);

}
else //line 21
{
transDateTotals.ins(ledgerTransTotals);
}
}
“ledgerTransTotals” is used to accumulate all the transactions. If the transaction is the first transaction needs to be checked, it goes into line 13. Otherwise, it goes into line 21. The ledgerTransTotals.AmountMST at line 16 should be 0 when the last transaction has been added, or it will not be posted. And you will receive a infolog “The trasaction on voucher *** do not balance”
Post a Comment