Hi,
I used the following code to get opening balance for a ledger account. It works well if we are not posting with dimensions.
If there are posting with dimensions it only includes the total without any dimensions.
How to get the full total including dimensions.
Example
assume ledger 1123333 has to entries posted
1123333 100
1123333-IT 50
The below function return 100 only, however i need 150 as total regardless of dimensions.
Please advice.
LedgerBalanceMainAccountAmounts ledgerBalance;
AmountMst opSum;
;
ledgerBalance = LedgerBalanceMainAccountAmounts::construct();
ledgerBalance.parmIncludeRegularPeriod(true);
ledgerBalance.parmIncludeOpeningPeriod(true);
ledgerBalance.parmIncludeClosingPeriod(false);
ledgerBalance.parmAccountingDateRange(mkDate(01,01,2017), mkDate(31,12,2017));
ledgerBalance.calculateBalance(MainAccount::findByMainAccountId('1123333'));
opSum = ledgerBalance.getAccountingCurrencyBalance();
info(num2str(opSum,10,2,1,1));
Thanks for SANTOSH KUMAR SINGH for posting this code.
Regards
Shijith