mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-25 10:20:29 -06:00
Fix #2805
This commit is contained in:
parent
a67b0f78a4
commit
828b9d32aa
@ -106,7 +106,6 @@ class AccountValidator
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
switch ($this->transactionType) {
|
||||
default:
|
||||
$this->destError = sprintf('AccountValidator::validateDestination cannot handle "%s", so it will always return false.', $this->transactionType);
|
||||
@ -574,7 +573,7 @@ class AccountValidator
|
||||
$found = $this->accountRepository->findNull($accountId);
|
||||
if (null !== $found) {
|
||||
$type = $found->accountType->type;
|
||||
if (in_array($type, $validTypes)) {
|
||||
if (in_array($type, $validTypes, true)) {
|
||||
return true;
|
||||
}
|
||||
$this->destError = (string)trans('validation.withdrawal_dest_bad_data', ['id' => $accountId, 'name' => $accountName]);
|
||||
|
@ -684,13 +684,13 @@ return [
|
||||
'source_dests' => [
|
||||
TransactionTypeModel::WITHDRAWAL => [
|
||||
AccountType::ASSET => [AccountType::EXPENSE, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE, AccountType::CASH],
|
||||
AccountType::LOAN => [AccountType::EXPENSE],
|
||||
AccountType::DEBT => [AccountType::EXPENSE],
|
||||
AccountType::MORTGAGE => [AccountType::EXPENSE],
|
||||
AccountType::LOAN => [AccountType::EXPENSE, AccountType::CASH],
|
||||
AccountType::DEBT => [AccountType::EXPENSE, AccountType::CASH],
|
||||
AccountType::MORTGAGE => [AccountType::EXPENSE, AccountType::CASH],
|
||||
],
|
||||
TransactionTypeModel::DEPOSIT => [
|
||||
AccountType::REVENUE => [AccountType::ASSET, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE],
|
||||
AccountType::CASH => [AccountType::ASSET],
|
||||
AccountType::CASH => [AccountType::ASSET, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE],
|
||||
AccountType::LOAN => [AccountType::ASSET],
|
||||
AccountType::DEBT => [AccountType::ASSET],
|
||||
AccountType::MORTGAGE => [AccountType::ASSET],
|
||||
|
Loading…
Reference in New Issue
Block a user