mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
This commit is contained in:
parent
c788395508
commit
edbac66576
@ -265,9 +265,10 @@ class AccountValidator
|
|||||||
|
|
||||||
// find by ID
|
// find by ID
|
||||||
if (null !== $accountId && $accountId > 0) {
|
if (null !== $accountId && $accountId > 0) {
|
||||||
$first = $this->accountRepository->find($accountId);
|
$first = $this->accountRepository->find($accountId);
|
||||||
$check = in_array($first->accountType->type, $validTypes, true);
|
$accountType = null === $first ? 'invalid' : $first->accountType->type;
|
||||||
$check = $inverse ? !$check : $check; // reverse the validation check if necessary.
|
$check = in_array($accountType, $validTypes, true);
|
||||||
|
$check = $inverse ? !$check : $check; // reverse the validation check if necessary.
|
||||||
if ((null !== $first) && $check) {
|
if ((null !== $first) && $check) {
|
||||||
app('log')->debug(sprintf('ID: Found %s account #%d ("%s", IBAN "%s")', $first->accountType->type, $first->id, $first->name, $first->iban ?? 'no iban'));
|
app('log')->debug(sprintf('ID: Found %s account #%d ("%s", IBAN "%s")', $first->accountType->type, $first->id, $first->name, $first->iban ?? 'no iban'));
|
||||||
return $first;
|
return $first;
|
||||||
@ -276,9 +277,10 @@ class AccountValidator
|
|||||||
|
|
||||||
// find by iban
|
// find by iban
|
||||||
if (null !== $accountIban && '' !== (string)$accountIban) {
|
if (null !== $accountIban && '' !== (string)$accountIban) {
|
||||||
$first = $this->accountRepository->findByIbanNull($accountIban, $validTypes);
|
$first = $this->accountRepository->findByIbanNull($accountIban, $validTypes);
|
||||||
$check = in_array($first->accountType->type, $validTypes, true);
|
$accountType = null === $first ? 'invalid' : $first->accountType->type;
|
||||||
$check = $inverse ? !$check : $check; // reverse the validation check if necessary.
|
$check = in_array($accountType, $validTypes, true);
|
||||||
|
$check = $inverse ? !$check : $check; // reverse the validation check if necessary.
|
||||||
if ((null !== $first) && $check) {
|
if ((null !== $first) && $check) {
|
||||||
app('log')->debug(sprintf('Iban: Found %s account #%d ("%s", IBAN "%s")', $first->accountType->type, $first->id, $first->name, $first->iban ?? 'no iban'));
|
app('log')->debug(sprintf('Iban: Found %s account #%d ("%s", IBAN "%s")', $first->accountType->type, $first->id, $first->name, $first->iban ?? 'no iban'));
|
||||||
return $first;
|
return $first;
|
||||||
@ -287,9 +289,10 @@ class AccountValidator
|
|||||||
|
|
||||||
// find by number
|
// find by number
|
||||||
if (null !== $accountNumber && '' !== (string)$accountNumber) {
|
if (null !== $accountNumber && '' !== (string)$accountNumber) {
|
||||||
$first = $this->accountRepository->findByAccountNumber($accountNumber, $validTypes);
|
$first = $this->accountRepository->findByAccountNumber($accountNumber, $validTypes);
|
||||||
$check = in_array($first->accountType->type, $validTypes, true);
|
$accountType = null === $first ? 'invalid' : $first->accountType->type;
|
||||||
$check = $inverse ? !$check : $check; // reverse the validation check if necessary.
|
$check = in_array($accountType, $validTypes, true);
|
||||||
|
$check = $inverse ? !$check : $check; // reverse the validation check if necessary.
|
||||||
if ((null !== $first) && $check) {
|
if ((null !== $first) && $check) {
|
||||||
app('log')->debug(sprintf('Number: Found %s account #%d ("%s", IBAN "%s")', $first->accountType->type, $first->id, $first->name, $first->iban ?? 'no iban'));
|
app('log')->debug(sprintf('Number: Found %s account #%d ("%s", IBAN "%s")', $first->accountType->type, $first->id, $first->name, $first->iban ?? 'no iban'));
|
||||||
return $first;
|
return $first;
|
||||||
|
Loading…
Reference in New Issue
Block a user