static void CashInHandClosing(Args _args)
{
Ledger ledger = ledger::findByLegalEntity(CompanyInfo::findDataArea("ASAP").RecId);
LedgerJournalTrans ledgerJournalTrans;
GeneralJournalEntry generalJournalEntry;
GeneralJournalAccountEntry generalJournalAccountEntry;
MainAccount MainAccount;
AmountCur openingBal,Debit,credit,closing;
while select ledgerJournalTrans
//where ledgerJournalTrans.PaymMode == "Cash"
join generalJournalEntry
index hint LedgerAccountingDateIdx
where generalJournalEntry.Ledger == ledger.RecId
&& generalJournalEntry.AccountingDate >= mkDate(16,04,2017)
&& generalJournalEntry.AccountingDate <= mkDate(16,04,2017)
&& generalJournalEntry.SubledgerVoucher == ledgerJournalTrans.Voucher
join sum(AccountingCurrencyAmount),sum(TransactionCurrencyAmount) from generalJournalAccountEntry
where generalJournalAccountEntry.GeneralJournalEntry == generalJournalEntry.RecId
join MainAccount
where MainAccount.RecId == generalJournalAccountEntry.MainAccount
&& MainAccount.MainAccountId == '1111001'
{
openingBal += generalJournalAccountEntry.AccountingCurrencyAmount;
Debit += generalJournalAccountEntry.AccountingCurrencyAmount;
credit += generalJournalAccountEntry.AccountingCurrencyAmount;
closing = (openingBal + Debit) - credit;
info(strFmt(" Amount --%1,Voucher --- %2,Company -- %3, closing ---%4", generalJournalAccountEntry.AccountingCurrencyAmount,generalJournalEntry.SubledgerVoucher,ledgerJournalTrans.Company, closing));//generalJournalAccountEntry.TransactionCurrencyAmount));
}
}
No comments:
Post a Comment