mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-03 19:16:51 +00:00
Currency exchange rate will not be saved when rate is 0.
This commit is contained in:
@@ -64,4 +64,4 @@ class CountAttachmentsFilter implements FilterInterface
|
|||||||
|
|
||||||
return $set;
|
return $set;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -64,4 +64,4 @@ class SplitIndicatorFilter implements FilterInterface
|
|||||||
|
|
||||||
return $set;
|
return $set;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -59,4 +59,4 @@ class Image extends BunqObject
|
|||||||
die(sprintf('Cannot convert %s to array.', get_class($this)));
|
die(sprintf('Cannot convert %s to array.', get_class($this)));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -87,4 +87,4 @@ class LabelUser extends BunqObject
|
|||||||
{
|
{
|
||||||
die(sprintf('Cannot convert %s to array.', get_class($this)));
|
die(sprintf('Cannot convert %s to array.', get_class($this)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -92,11 +92,13 @@ class FixerIOv2 implements ExchangeRateInterface
|
|||||||
}
|
}
|
||||||
if (null !== $content) {
|
if (null !== $content) {
|
||||||
$code = $toCurrency->code;
|
$code = $toCurrency->code;
|
||||||
$rate = isset($content['rates'][$code]) ? $content['rates'][$code] : '0';
|
$rate = $content['rates'][$code] ?? 0;
|
||||||
}
|
}
|
||||||
Log::debug('Got the following rates from Fixer: ', $content['rates'] ?? []);
|
Log::debug('Got the following rates from Fixer: ', $content['rates'] ?? []);
|
||||||
$exchangeRate->rate = $rate;
|
$exchangeRate->rate = $rate;
|
||||||
$exchangeRate->save();
|
if ($rate !== 0) {
|
||||||
|
$exchangeRate->save();
|
||||||
|
}
|
||||||
|
|
||||||
return $exchangeRate;
|
return $exchangeRate;
|
||||||
}
|
}
|
||||||
|
@@ -43,4 +43,4 @@ class CategoryDestroyService
|
|||||||
Log::error(sprintf('Could not delete category: %s', $e->getMessage())); // @codeCoverageIgnore
|
Log::error(sprintf('Could not delete category: %s', $e->getMessage())); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -45,4 +45,4 @@ class CurrencyDestroyService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -45,4 +45,4 @@ class CategoryUpdateService
|
|||||||
return $category;
|
return $category;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -47,4 +47,4 @@ class CurrencyUpdateService
|
|||||||
return $currency;
|
return $currency;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
Reference in New Issue
Block a user