New version

This commit is contained in:
Sander Dorigo 2023-06-23 11:07:50 +02:00
parent 0cab974048
commit 63a7a4b03b

View File

@ -122,6 +122,16 @@ trait DepositValidation
$result = false; $result = false;
} }
// if there is an iban, it can only be in use by a revenue account or we will fail.
if(null !== $accountIban && '' !== $accountIban) {
app('log')->debug('Check if there is not already an account with this IBAN');
$existing = $this->findExistingAccount([AccountType::ASSET, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE], ['iban' => $accountIban]);
if(null !== $existing) {
$this->destError = (string)trans('validation.deposit_src_iban_exists');
return false;
}
}
// if the user submits an ID, but that ID is not of the correct type, // if the user submits an ID, but that ID is not of the correct type,
// return false. // return false.
if (null !== $accountId) { if (null !== $accountId) {