Подумал, что логично будет в этот раскрученный топик закинуть инфу по расчету курса
X++:
static void ExchangeRate(Args _args)
{
// from CurrencyExchangeHelper class
CurrencyExchangeHelper currencyExchangeHelper;
TransDate transactionDate = today();
CurrencyCode transactionCurrency = 'USD';
AmountCur amountToConvert = 100.50;
boolean shouldRoundResult = true;
AmountMst result;
currencyExchangeHelper =
CurrencyExchangeHelper::newExchangeDate(
Ledger::current(),
transactionDate);
result =
currencyExchangeHelper.calculateTransactionToAccounting( transactionCurrency, amountToConvert, shouldRoundResult);
info(strfmt("%1",result));
}
X++:
static void ExchangeRate2(Args _args)
{
ExchangeRateHelper exchangeRateHelper;
TransDate transactionDate = today();
CurrencyCode transactionCurrency = 'USD';
CurrencyExchangeRate exchangeRate1;
CurrencyExchangeRate exchangeRate2;
exchangeRateHelper = ExchangeRateHelper::newExchangeDate(
Ledger::current(),
transactionCurrency,
transactionDate);
exchangeRate1 = exchangeRateHelper.getExchangeRate1();
exchangeRate2 = exchangeRateHelper.getExchangeRate2();
info (strfmt("ExchRate1= %1; ExchRate2= %2", exchangeRate1, exchangeRate2));
}