diff --git a/README.md b/README.md index 630cd679d7..419627813e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Firefly III -#### v3.4.0.5 +#### v3.4.0.6 [![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) @@ -13,11 +13,13 @@ "Firefly III" is a financial manager. It can help you keep track of expenses, income, budgets and everything in between. It even supports credit cards, shared household accounts and savings accounts! It's pretty fancy. You should use it to save and organise money. -Firefly is a system you'll have install yourself on webhosting of your choosing. +_Firefly is a system you'll have install yourself on webhosting of your choosing._ Personal financial management is pretty difficult, and everybody has their own approach to it. Some people -make budgets, other people limit their cashflow by throwing away their credit cards, others get a better job. -There are tons of ways to save and earn money. +make budgets, other people limit their cashflow by throwing away their credit cards, others try to increase +their current cashflow. There are tons of ways to save and earn money. + +Firefly works on the principle that if you know where you're money is going, you can stop it from going there. To get to know Firefly, and to see if it fits you, check out these resources: @@ -28,7 +30,7 @@ To get to know Firefly, and to see if it fits you, check out these resources: and the philosophy behind it. -### About the name (if you care) +#### About the name (if you care) It's III, or 3, because [version 2](https://github.com/JC5/Firefly) and version 1 (not online) preceded it. It has been growing steadily ever since. diff --git a/app/Handlers/Events/ConnectJournalToPiggyBank.php b/app/Handlers/Events/ConnectJournalToPiggyBank.php index 7d19f28521..1f3d2a2e70 100644 --- a/app/Handlers/Events/ConnectJournalToPiggyBank.php +++ b/app/Handlers/Events/ConnectJournalToPiggyBank.php @@ -30,7 +30,7 @@ class ConnectJournalToPiggyBank * * @param JournalCreated $event * - * @return void + * @return boolean */ public function handle(JournalCreated $event) { @@ -38,7 +38,7 @@ class ConnectJournalToPiggyBank $journal = $event->journal; $piggyBankId = $event->piggyBankId; if (intval($piggyBankId) < 1) { - return; + return false; } Log::debug('JournalCreated event: ' . $journal->id . ', ' . $piggyBankId); @@ -47,20 +47,20 @@ class ConnectJournalToPiggyBank $piggyBank = Auth::user()->piggybanks()->where('piggy_banks.id', $piggyBankId)->first(['piggy_banks.*']); if (is_null($piggyBank) || $journal->transactionType->type != 'Transfer') { - return; + return false; } Log::debug('Found a piggy bank'); $amount = $journal->amount; Log::debug('Amount: ' . $amount); if ($amount == 0) { - return; + return false; } // update piggy bank rep for date of transaction journal. $repetition = $piggyBank->piggyBankRepetitions()->relevantOnDate($journal->date)->first(); if (is_null($repetition)) { Log::debug('Found no repetition for piggy bank for date ' . $journal->date->format('Y M d')); - return; + return false; } Log::debug('Found rep! ' . $repetition->id); @@ -91,6 +91,7 @@ class ConnectJournalToPiggyBank 'amount' => $amount ] ); + return true; } diff --git a/app/Handlers/Events/RescanJournal.php b/app/Handlers/Events/RescanJournal.php index aaa21b515a..b44924b6d8 100644 --- a/app/Handlers/Events/RescanJournal.php +++ b/app/Handlers/Events/RescanJournal.php @@ -7,6 +7,7 @@ use Log; /** * Class RescanJournal * + * @codeCoverageIgnore * @package FireflyIII\Handlers\Events */ class RescanJournal diff --git a/app/Handlers/Events/UpdateJournalConnection.php b/app/Handlers/Events/UpdateJournalConnection.php index f18f0bf17e..13b60c8420 100644 --- a/app/Handlers/Events/UpdateJournalConnection.php +++ b/app/Handlers/Events/UpdateJournalConnection.php @@ -6,6 +6,7 @@ use FireflyIII\Models\PiggyBankEvent; /** * Class UpdateJournalConnection * + * @codeCoverageIgnore * @package FireflyIII\Handlers\Events */ class UpdateJournalConnection diff --git a/app/Helpers/Help/Help.php b/app/Helpers/Help/Help.php index eddad2614f..19bab089e9 100644 --- a/app/Helpers/Help/Help.php +++ b/app/Helpers/Help/Help.php @@ -17,6 +17,7 @@ class Help implements HelpInterface { /** + * @codeCoverageIgnore * @param $key * * @return string @@ -27,6 +28,7 @@ class Help implements HelpInterface } /** + * @codeCoverageIgnore * @param $route * * @return array @@ -54,6 +56,7 @@ class Help implements HelpInterface } /** + * @codeCoverageIgnore * @param $route * * @return bool @@ -64,6 +67,7 @@ class Help implements HelpInterface } /** + * @codeCoverageIgnore * @param $route * @param array $content * @@ -76,6 +80,7 @@ class Help implements HelpInterface } /** + * @codeCoverageIgnore * @param $route * * @return bool diff --git a/app/Helpers/Reminders/ReminderHelper.php b/app/Helpers/Reminders/ReminderHelper.php index 530d3b3c78..53484378ea 100644 --- a/app/Helpers/Reminders/ReminderHelper.php +++ b/app/Helpers/Reminders/ReminderHelper.php @@ -33,7 +33,7 @@ class ReminderHelper implements ReminderHelperInterface $ranges = $this->getReminderRanges($piggyBank, $start); $currentRep = $piggyBank->currentRelevantRep(); $left = $piggyBank->targetamount - $currentRep->currentamount; - $perReminder = $left / count($ranges); + $perReminder = count($ranges) == 0 ? $left : $left / count($ranges); } else { $perReminder = null; $ranges = []; @@ -46,8 +46,6 @@ class ReminderHelper implements ReminderHelperInterface 'leftToSave' => $left, ]; - - // create one: $reminder = new Reminder; $reminder->user()->associate(Auth::user()); $reminder->startdate = $start; diff --git a/app/Helpers/Report/ReportHelper.php b/app/Helpers/Report/ReportHelper.php index 9efbd64e74..b06c6237e9 100644 --- a/app/Helpers/Report/ReportHelper.php +++ b/app/Helpers/Report/ReportHelper.php @@ -18,25 +18,6 @@ use Steam; class ReportHelper implements ReportHelperInterface { - /** - * This methods fails to take in account transfers FROM shared accounts. - * - * @param Carbon $start - * @param Carbon $end - * @param int $limit - * - * @return Collection - */ - public function expensesGroupedByAccount(Carbon $start, Carbon $end, $limit = 15) - { - $result = $this->_queries->journalsByExpenseAccount($start, $end); - $array = $this->_helper->makeArray($result); - $limited = $this->_helper->limitArray($array, $limit); - - return $limited; - - } - /** * This method gets some kind of list for a monthly overview. * diff --git a/app/Helpers/Report/ReportHelperInterface.php b/app/Helpers/Report/ReportHelperInterface.php index 2bbbefec75..8b66f48f15 100644 --- a/app/Helpers/Report/ReportHelperInterface.php +++ b/app/Helpers/Report/ReportHelperInterface.php @@ -13,18 +13,6 @@ use Illuminate\Support\Collection; interface ReportHelperInterface { - - /** - * This methods fails to take in account transfers FROM shared accounts. - * - * @param Carbon $start - * @param Carbon $end - * @param int $limit - * - * @return Collection - */ - public function expensesGroupedByAccount(Carbon $start, Carbon $end, $limit = 15); - /** * This method gets some kind of list for a monthly overview. * diff --git a/app/Http/Middleware/PiggyBanks.php b/app/Http/Middleware/PiggyBanks.php index 8c00cf2376..810f396fce 100644 --- a/app/Http/Middleware/PiggyBanks.php +++ b/app/Http/Middleware/PiggyBanks.php @@ -46,7 +46,7 @@ class PiggyBanks */ public function handle(Request $request, Closure $next) { - if ($this->auth->check() && !$request->isXmlHttpRequest() && App::environment() != 'testing') { + if ($this->auth->check() && !$request->isXmlHttpRequest()) { // get piggy banks without a repetition: /** @var Collection $set */ $set = $this->auth->user()->piggybanks() diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.php index 7407e4a7d2..aa7fd7a98b 100644 --- a/app/Http/Middleware/Range.php +++ b/app/Http/Middleware/Range.php @@ -48,7 +48,7 @@ class Range */ public function handle(Request $request, Closure $theNext) { - if ($this->auth->check() && App::environment() != 'testing') { + if ($this->auth->check()) { // ignore preference. set the range to be the current month: if (!Session::has('start') && !Session::has('end')) { diff --git a/app/Http/Middleware/Reminders.php b/app/Http/Middleware/Reminders.php index 457e4e2543..55c555aec0 100644 --- a/app/Http/Middleware/Reminders.php +++ b/app/Http/Middleware/Reminders.php @@ -46,7 +46,7 @@ class Reminders */ public function handle(Request $request, Closure $next) { - if ($this->auth->check() && !$request->isXmlHttpRequest() && App::environment() != 'testing') { + if ($this->auth->check() && !$request->isXmlHttpRequest()) { // do reminders stuff. $piggyBanks = $this->auth->user()->piggyBanks()->where('remind_me', 1)->get(); $today = new Carbon; diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index d66ebb30f4..b0e3ac5559 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -246,13 +246,12 @@ class BudgetRepository implements BudgetRepositoryInterface ->whereNotNull('budget_transaction_journal.budget_id'); } ) - ->before($end) ->after($start) + ->before($end) ->lessThan(0) ->transactionTypes(['Withdrawal']) - ->get(); - - return floatval($noBudgetSet->sum('amount')) * -1; + ->sum('transactions.amount'); + return floatval($noBudgetSet) * -1; } /** diff --git a/resources/twig/layout/default.twig b/resources/twig/layout/default.twig index 149ecced8c..cb4ec3bf4a 100644 --- a/resources/twig/layout/default.twig +++ b/resources/twig/layout/default.twig @@ -60,7 +60,7 @@

{% if mainTitleIcon %} - + {% endif %} {{ title }} @@ -68,12 +68,12 @@ {% if subTitle %} {% if subTitleIcon %} - + {% endif %} {{ subTitle }} {% endif %} -