Tuesday, January 16, 2018

Get tax amount from journal through x++ AX 2012

static void Nirm_CorrectedTaxAmount(Args _args)//ADDED BY NIRMAL
{
    LedgerJournalTrans _ledgerJournalTrans;
    LedgerJournalEngine LedgerJournalEngine;

    LedgerJournalEngine = new LedgerJournalEngine();

    select _ledgerJournalTrans where _ledgerJournalTrans.JournalNum == "JB/0004662";

    info(strFmt("%1",LedgerJournalEngine.getShowTax(_ledgerJournalTrans).calcTax()));
    info(strFmt("%1",ledgerJournalEngine.correctedTaxAmount(_ledgerJournalTrans)));
}


            if(ledgerJournalTable.Posted)
            {
                VATAmount = abs(Tax::taxAmountCorrectedPerLine(_ledgerJournalTrans.Voucher,
                                                              _ledgerJournalTrans.TransDate,
                                                              _ledgerJournalTrans.RecId));
            }
            else
            {
                VATAmount =  abs(ledgerJournalEngine.correctedTaxAmount(_ledgerJournalTrans));

            }

No comments:

Post a Comment