Thursday, November 24, 2016

RA budget code by anand

static void TestJobActualVSBudsget(Args _args)
{
    GeneralJournalAccountEntry      generalJournalAccountEntry;
    GeneralJournalEntry             generalJournalEntry;
    TransDate                       _fiscalPeriodStartDate = mkDate(1,4,2016);
    TransDate                       _fiscalPeriodEndDate = mkDate(31,3,2017);
    AmountCur                       LedgerAmount, LedgerAmount1,LedgerAmount2;

    while select generalJournalEntry where generalJournalEntry.Ledger == 5637145326 && generalJournalEntry.PostingLayer == CurrentOperationsTax::Current
    && generalJournalEntry.AccountingDate >= fiscalPeriodStartDate && generalJournalEntry.AccountingDate  <= fiscalPeriodEndDate
    join sum(AccountingCurrencyAmount) from generalJournalAccountEntry where generalJournalAccountEntry.LedgerDimension == 5637150892
    && generalJournalAccountEntry.GeneralJournalEntry == generalJournalEntry.RecId
               
                {
                    LedgerAmount1 = generalJournalAccountEntry.AccountingCurrencyAmount;
                    info(strFmt("LedgerAmount1 = %1",LedgerAmount1));
                }
   
    while select generalJournalEntry where generalJournalEntry.Ledger == 5637145326 && generalJournalEntry.PostingLayer == CurrentOperationsTax::Current
    && generalJournalEntry.AccountingDate >= fiscalPeriodStartDate && generalJournalEntry.AccountingDate  <= fiscalPeriodEndDate
    join sum(AccountingCurrencyAmount) from generalJournalAccountEntry where generalJournalAccountEntry.LedgerDimension == 5637198803
    && generalJournalAccountEntry.GeneralJournalEntry == generalJournalEntry.RecId
               
                {
                    LedgerAmount2 = generalJournalAccountEntry.AccountingCurrencyAmount;
                    info(strFmt("LedgerAmount2 = %1",LedgerAmount2));
                }
    LedgerAmount = LedgerAmount1 + LedgerAmount2;
       
    info(strFmt("Total Ledger Amount = %1",LedgerAmount));
}