Refactor some code for recurrences.

This commit is contained in:
James Cole
2019-06-08 06:19:21 +02:00
parent 7c2c24d330
commit 85f9c256a1
21 changed files with 369 additions and 468 deletions

View File

@@ -112,7 +112,7 @@ class AccountFactory
$data['currency_id'] = $currency->id;
// remove virtual balance when not an asset account or a liability
$canHaveVirtual = [AccountType::ASSET, AccountType::DEBT, AccountType::LOAN, AccountType::MORTGAGE, AccountType::CREDITCARD];
if (!\in_array($type->type, $canHaveVirtual, true)) {
if (!in_array($type->type, $canHaveVirtual, true)) {
$databaseData['virtual_balance'] = '0';
}
@@ -124,7 +124,7 @@ class AccountFactory
$return = Account::create($databaseData);
$this->updateMetaData($return, $data);
if (\in_array($type->type, $canHaveVirtual, true)) {
if (in_array($type->type, $canHaveVirtual, true)) {
if ($this->validIBData($data)) {
$this->updateIB($return, $data);
}