I have to Wright a simple sql statement for Calculating Closing balance.??
There are classes for calculating the balances
see \Classes\LedgerBalanceMainAccountAmounts
can u plz wright a simple sql Query.?
Here is a Job,
static void findBalance(Args _args)
{
GeneralJournalAccountEntry generalJournalAccountEntry;
MainAccountLedgerDimensionView mainAccountLedgerDimensionView;
SubledgerVoucherGeneralJournalEntry subledgerVoucherLink;
GeneralJournalEntry generalJournalEntry;
while select sum(AccountingCurrencyAmount) from generalJournalAccountEntry
join RecId from generalJournalEntry
where generalJournalEntry.RecId == generalJournalAccountEntry.GeneralJournalEntry &&
generalJournalEntry.PostingLayer == CurrentOperationsTax::Current
join RecId from subledgerVoucherLink
where subledgerVoucherLink.VoucherDataAreaId == curext() &&
subledgerVoucherLink.GeneralJournalEntry == generalJournalEntry.RecId // &&
//subledgerVoucherLink.AccountingDate >= mkDate(01,07,2013) &&
//subledgerVoucherLink.AccountingDate <= mkDate(30,06,2014)
join MainAccount from mainAccountLedgerDimensionView
group by MainAccount
where mainAccountLedgerDimensionView.LedgerDimensionId == generalJournalAccountEntry.LedgerDimension
{
info(strFmt(’%1, Amount = %2’, mainAccountLedgerDimensionView.MainAccount, generalJournalAccountEntry.AccountingCurrencyAmount));
}
}
thnxxx …