Skip to content

Firefly III: a personal finances manager

Small change in conversion

James Cole70ddbd743cb7
diff --git a/app/Support/Http/Api/ConvertsExchangeRates.php b/app/Support/Http/Api/ConvertsExchangeRates.php
index a4c6a04f8d..7a773bcf9d 100644
--- a/app/Support/Http/Api/ConvertsExchangeRates.php
+++ b/app/Support/Http/Api/ConvertsExchangeRates.php
@@ -63,10 +63,10 @@ trait ConvertsExchangeRates
$return = [];
/** @var array $entry */
foreach ($entries as $entry) {
- $currency = $this->getCurrency((int) $entry['id']);
- $entry['converted'] = true;
+ $currency = $this->getCurrency((int) $entry['id']);
if ($currency->id !== $native->id) {
$amount = $this->convertAmount($entry['sum'], $currency, $native);
+ $entry['converted'] = true;
$entry['native_sum'] = $amount;
$entry['native_id'] = (string) $native->id;
$entry['native_name'] = $native->name;
@@ -75,6 +75,7 @@ trait ConvertsExchangeRates
$entry['native_decimal_places'] = $native->decimal_places;
}
if ($currency->id === $native->id) {
+ $entry['converted'] = false;
$entry['native_sum'] = $entry['sum'];
$entry['native_id'] = (string) $native->id;
$entry['native_name'] = $native->name;