Fix validation #1720

This commit is contained in:
James Cole
2018-09-26 20:35:01 +02:00
parent b5efd38ded
commit aa1ae18dbb

View File

@@ -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":