mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-12 01:42:32 +00:00
Code for new release
This commit is contained in:
@@ -123,10 +123,10 @@ trait DepositValidation
|
||||
}
|
||||
|
||||
// if there is an iban, it can only be in use by a revenue account or we will fail.
|
||||
if(null !== $accountIban && '' !== $accountIban) {
|
||||
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) {
|
||||
if (null !== $existing) {
|
||||
$this->destError = (string)trans('validation.deposit_src_iban_exists');
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ trait TransferValidation
|
||||
*/
|
||||
protected function validateTransferDestination(array $array): bool
|
||||
{
|
||||
$accountId = array_key_exists('id', $array) ? $array['id'] : null;
|
||||
$accountId = array_key_exists('id', $array) ? $array['id'] : null;
|
||||
$accountName = array_key_exists('name', $array) ? $array['name'] : null;
|
||||
$accountIban = array_key_exists('iban', $array) ? $array['iban'] : null;
|
||||
Log::debug('Now in validateTransferDestination', $array);
|
||||
@@ -65,7 +65,7 @@ trait TransferValidation
|
||||
// must not be the same as the source account
|
||||
if (null !== $this->source && $this->source->id === $this->destination->id) {
|
||||
$this->sourceError = 'Source and destination are the same.';
|
||||
$this->destError = 'Source and destination are the same.';
|
||||
$this->destError = 'Source and destination are the same.';
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -95,9 +95,9 @@ trait TransferValidation
|
||||
*/
|
||||
protected function validateTransferSource(array $array): bool
|
||||
{
|
||||
$accountId = array_key_exists('id', $array) ? $array['id'] : null;
|
||||
$accountName = array_key_exists('name', $array) ? $array['name'] : null;
|
||||
$accountIban = array_key_exists('iban', $array) ? $array['iban'] : null;
|
||||
$accountId = array_key_exists('id', $array) ? $array['id'] : null;
|
||||
$accountName = array_key_exists('name', $array) ? $array['name'] : null;
|
||||
$accountIban = array_key_exists('iban', $array) ? $array['iban'] : null;
|
||||
$accountNumber = array_key_exists('number', $array) ? $array['number'] : null;
|
||||
Log::debug('Now in validateTransferSource', $array);
|
||||
// source can be any of the following types.
|
||||
|
||||
@@ -119,10 +119,10 @@ trait WithdrawalValidation
|
||||
}
|
||||
}
|
||||
// if there is an iban, it can only be in use by a revenue account or we will fail.
|
||||
if(null !== $accountIban && '' !== $accountIban) {
|
||||
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) {
|
||||
if (null !== $existing) {
|
||||
$this->destError = (string)trans('validation.withdrawal_dest_iban_exists');
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user