Skip to content

Firefly III: a personal finances manager

Some cleaning up.

James Cole72f04aaedccf
diff --git a/README.md b/README.md
index a65289f98f..5a0777ec10 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,6 @@ Firefly III (v3.2.5)
[![Build Status](https://travis-ci.org/JC5/firefly-iii.svg?branch=develop)](https://travis-ci.org/JC5/firefly-iii)
[![Project Status](http://stillmaintained.com/JC5/firefly-iii.png?a=b)](http://stillmaintained.com/JC5/firefly-iii)
-[![Coverage Status](https://coveralls.io/repos/JC5/firefly-iii/badge.png?branch=master)](https://coveralls.io/r/JC5/firefly-iii?branch=master)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/d44c7012-5f50-41ad-add8-8445330e4102/mini.png)](https://insight.sensiolabs.com/projects/d44c7012-5f50-41ad-add8-8445330e4102)
[![Code Climate](https://codeclimate.com/github/JC5/firefly-iii/badges/gpa.svg)](https://codeclimate.com/github/JC5/firefly-iii)
[![Test Coverage](https://codeclimate.com/github/JC5/firefly-iii/badges/coverage.svg)](https://codeclimate.com/github/JC5/firefly-iii)
diff --git a/app/lib/FireflyIII/Database/Account/Account.php b/app/lib/FireflyIII/Database/Account/Account.php
index f450f293e2..816274cc49 100644
--- a/app/lib/FireflyIII/Database/Account/Account.php
+++ b/app/lib/FireflyIII/Database/Account/Account.php
@@ -331,6 +331,7 @@ class Account implements CUDInterface, CommonDatabaseCallsInterface, AccountInte
*/
public function validate(array $model)
{
+ $model['active'] = !isset($model['active']) ? false : $model['active'];
$successes = new MessageBag;
$account = new \Account($model);
$account->isValid('form_input', false);
diff --git a/app/lib/FireflyIII/Helper/TransactionJournal/Helper.php b/app/lib/FireflyIII/Helper/TransactionJournal/Helper.php
index 90ef11060d..8c0c15a3bc 100644
--- a/app/lib/FireflyIII/Helper/TransactionJournal/Helper.php
+++ b/app/lib/FireflyIII/Helper/TransactionJournal/Helper.php
@@ -40,7 +40,18 @@ class Helper implements HelperInterface
/** @var \FireflyIII\Database\Account\Account $accountRepository */
$accountRepository = \App::make('FireflyIII\Database\Account\Account');
- return $accountRepository->getAccountsByType(['Default account', 'Asset account']);
+ /** @var Collection $list */
+ $list = $accountRepository->getAccountsByType(['Default account', 'Asset account']);
+ $filtered = $list->filter(
+ function (\Account $account) {
+ if (intval($account->active) === 1) {
+ return $account;
+ }
+ return null;
+ }
+ );
+
+ return $filtered;
}
/**