Tuesday, February 3, 2015

Currency Converter through x++

// Currency Converter through x++

static void CurrencyConverter(Args _args)
{
    CurrencyExchangeHelper currencyExchangeHelper;
    CurrencyCode transCurrency = 'SAR';
    AmountCur amountCur = 500.00;
    AmountMst amountMST,amount;

    currencyExchangeHelper = CurrencyExchangeHelper::newExchangeDate(Ledger::current(),01\01\2014);
    amountMST = currencyExchangeHelper.calculateTransactionToAccounting(transCurrency, amountCur ,true);
    amount = currencyExchangeHelper.calculateCurrencyToCurrency("USD" ,transCurrency,amountCur,true);
    info(strFmt("%1",amountMST));
    info(strFmt("%1",amount));
 
    //ExchangeRateHelper  excRateHelper;
    //TransDate           todate = mkDate(01,12,2006);
    //CurrencyCode        transactionCur = "EUR";
    //CurrencyExchangeRate    exchangeRate;
    //;
    //excRateHelper = ExchangeRateHelper::newExchangeDate(Ledger::current(),transactionCur,todate);
    //exchangeRate = excRateHelper.getExchangeRate1();
    //info(num2str(exchangeRate/100,2,2,1,1));
}

No comments:

Post a Comment

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...