mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix currency search.
This commit is contained in:
parent
778af9f4e2
commit
ed17600f79
@ -677,6 +677,13 @@ class OperatorQuerySearch implements SearchInterface
|
||||
*/
|
||||
private function findCurrency(string $value): ?TransactionCurrency
|
||||
{
|
||||
if(str_contains($value,'(') && str_contains($value,')')) {
|
||||
// bad method to split and get the currency code:
|
||||
$parts = explode(' ', $value);
|
||||
$value = trim($parts[count($parts) -1], "() \t\n\r\0\x0B");
|
||||
}
|
||||
|
||||
|
||||
$result = $this->currencyRepository->findByCodeNull($value);
|
||||
if (null === $result) {
|
||||
$result = $this->currencyRepository->findByNameNull($value);
|
||||
|
Loading…
Reference in New Issue
Block a user