mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 19:01:58 +00:00
Fix transfer validation for CAMT imports
This commit is contained in:
@@ -97,10 +97,14 @@ trait TransferValidation
|
|||||||
{
|
{
|
||||||
$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;
|
$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);
|
Log::debug('Now in validateTransferSource', $array);
|
||||||
// source can be any of the following types.
|
// source can be any of the following types.
|
||||||
$validTypes = array_keys($this->combinations[$this->transactionType]);
|
$validTypes = array_keys($this->combinations[$this->transactionType]);
|
||||||
if (null === $accountId && null === $accountName && false === $this->canCreateTypes($validTypes)) {
|
if (null === $accountId && null === $accountName
|
||||||
|
&& null === $accountIban && null === $accountNumber
|
||||||
|
&& false === $this->canCreateTypes($validTypes)) {
|
||||||
// if both values are NULL we return false,
|
// if both values are NULL we return false,
|
||||||
// because the source of a withdrawal can't be created.
|
// because the source of a withdrawal can't be created.
|
||||||
$this->sourceError = (string)trans('validation.transfer_source_need_data');
|
$this->sourceError = (string)trans('validation.transfer_source_need_data');
|
||||||
|
Reference in New Issue
Block a user