mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 10:53:37 +00:00
Fix validation #1720
This commit is contained in:
@@ -292,9 +292,10 @@ class FireflyValidator extends Validator
|
|||||||
if ('convert_transfer' === $actionType) {
|
if ('convert_transfer' === $actionType) {
|
||||||
/** @var AccountRepositoryInterface $repository */
|
/** @var AccountRepositoryInterface $repository */
|
||||||
$repository = app(AccountRepositoryInterface::class);
|
$repository = app(AccountRepositoryInterface::class);
|
||||||
$account = $repository->findByName($value,
|
$account = $repository->findByName(
|
||||||
[AccountType::DEFAULT, AccountType::ASSET, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE,
|
$value,
|
||||||
AccountType::CREDITCARD]
|
[AccountType::DEFAULT, AccountType::ASSET, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE,
|
||||||
|
AccountType::CREDITCARD]
|
||||||
);
|
);
|
||||||
|
|
||||||
return null !== $account;
|
return null !== $account;
|
||||||
@@ -344,9 +345,9 @@ class FireflyValidator extends Validator
|
|||||||
|
|
||||||
// check transaction type.
|
// check transaction type.
|
||||||
if ('transaction_type' === $triggerType) {
|
if ('transaction_type' === $triggerType) {
|
||||||
$count = TransactionType::where('type', $value)->count();
|
$count = TransactionType::where('type', strtolower($value))->count();
|
||||||
|
|
||||||
return 1 !== $count;
|
return 1 === $count;
|
||||||
}
|
}
|
||||||
|
|
||||||
// and finally a "will match everything check":
|
// and finally a "will match everything check":
|
||||||
|
Reference in New Issue
Block a user