Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Extra code for #1975
James Cole8998c9a672ee
diff --git a/app/Support/Import/JobConfiguration/Spectre/ChooseAccountsHandler.php b/app/Support/Import/JobConfiguration/Spectre/ChooseAccountsHandler.phpindex 7c7c402cf1..a781e1fb4d 100644--- a/app/Support/Import/JobConfiguration/Spectre/ChooseAccountsHandler.php+++ b/app/Support/Import/JobConfiguration/Spectre/ChooseAccountsHandler.php@@ -151,7 +151,7 @@ class ChooseAccountsHandler implements SpectreJobConfigurationInterface}// list the users accounts:- $accounts = $this->accountRepository->getAccountsByType([AccountType::ASSET]);+ $accounts = $this->accountRepository->getAccountsByType([AccountType::ASSET, AccountType::DEBT, AccountType::LOAN, AccountType::MORTGAGE]);$array = [];/** @var AccountModel $account */diff --git a/app/Support/Import/Routine/Spectre/StageImportDataHandler.php b/app/Support/Import/Routine/Spectre/StageImportDataHandler.phpindex 66d6cc8518..443b889fd6 100644--- a/app/Support/Import/Routine/Spectre/StageImportDataHandler.php+++ b/app/Support/Import/Routine/Spectre/StageImportDataHandler.php@@ -233,8 +233,8 @@ class StageImportDataHandlerif (null === $account) {throw new FireflyException(sprintf('Cannot find Firefly III asset account with ID #%d. Job must stop now.', $accountId)); // @codeCoverageIgnore}- if ($account->accountType->type !== AccountType::ASSET) {- throw new FireflyException(sprintf('Account with ID #%d is not an asset account. Job must stop now.', $accountId)); // @codeCoverageIgnore+ if (!\in_array($account->accountType->type ,[AccountType::ASSET, AccountType::LOAN, AccountType::MORTGAGE, AccountType::DEBT], true)) {+ throw new FireflyException(sprintf('Account with ID #%d is not an asset/loan/mortgage/debt account. Job must stop now.', $accountId)); // @codeCoverageIgnore}return $account;