Include BIC in import routine

This commit is contained in:
James Cole 2018-03-19 10:03:08 +01:00
parent 31146954d1
commit e2ecaf5bcf
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
3 changed files with 21 additions and 1 deletions

View File

@ -38,6 +38,8 @@ class ImportAccount
/** @var Account */
private $account;
/** @var array */
private $accountBic = [];
/** @var array */
private $accountIban = [];
/** @var array */
private $accountId = [];
@ -105,6 +107,14 @@ class ImportAccount
$this->expectedType = $expectedType;
}
/**
* @param array $accountBic
*/
public function setAccountBic(array $accountBic): void
{
$this->accountBic = $accountBic;
}
/**
* @codeCoverageIgnore
*
@ -388,6 +398,7 @@ class ImportAccount
'active' => true,
'virtualBalance' => '0',
'account_type_id' => null,
'BIC' => $this->accountBic['value'] ?? null,
];
$this->account = $this->repository->store($data);

View File

@ -283,6 +283,9 @@ class ImportJournal
case 'opposing-id':
$this->opposing->setAccountId($array);
break;
case 'opposing-bic':
$this->opposing->setAccountBic($array);
break;
case 'tags-comma':
case 'tags-space':
$this->setTags($array);

View File

@ -266,6 +266,12 @@ return [
'converter' => 'AccountId',
'mapper' => 'OpposingAccounts',
],
'opposing-bic' => [
'mappable' => false,
'pre-process-map' => false,
'field' => 'opposing-account-bic',
'converter' => 'AccountBic',
],
'opposing-name' => [
'mappable' => true,
'pre-process-map' => false,