mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-09 23:41:10 +00:00
Fix #11054
This commit is contained in:
@@ -88,6 +88,7 @@ trait JournalServiceTrait
|
||||
|
||||
// the account that Firefly III creates must be "creatable", aka select the one we can create from the list just in case
|
||||
$creatableType = $this->getCreatableType($expectedTypes[$transactionType]);
|
||||
Log::debug(sprintf('Creatable type is "%s"', $creatableType ), $expectedTypes[$transactionType]);
|
||||
|
||||
// if the result is NULL but the ID is set, an account could exist of the wrong type.
|
||||
// that data can be used to create a new account of the right type.
|
||||
@@ -227,9 +228,11 @@ trait JournalServiceTrait
|
||||
}
|
||||
|
||||
// find by preferred type.
|
||||
Log::debug('Find by preferred type.');
|
||||
$result = $this->accountRepository->findByName($data['name'], [$types[0]]);
|
||||
|
||||
// or any expected type.
|
||||
Log::debug('Find by any expected type.');
|
||||
$result ??= $this->accountRepository->findByName($data['name'], $types);
|
||||
|
||||
if (null !== $result) {
|
||||
|
||||
Reference in New Issue
Block a user