Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Cleaning up.
James Coledb4adf399d93
diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.phpindex db387e39ad..3bd0736110 100644--- a/app/Http/Controllers/AccountController.php+++ b/app/Http/Controllers/AccountController.php@@ -26,6 +26,7 @@ class AccountController extends Controller*/public function __construct(){+ parent::__construct();View::share('mainTitleIcon', 'fa-credit-card');View::share('title', 'Accounts');}diff --git a/app/Http/Controllers/BillController.php b/app/Http/Controllers/BillController.phpindex f509e1ddb5..ad1075ea8e 100644--- a/app/Http/Controllers/BillController.php+++ b/app/Http/Controllers/BillController.php@@ -29,6 +29,7 @@ class BillController extends Controller*/public function __construct(){+ parent::__construct();View::share('title', 'Bills');View::share('mainTitleIcon', 'fa-calendar-o');}diff --git a/app/Http/Controllers/BudgetController.php b/app/Http/Controllers/BudgetController.phpindex 92078806b0..f72ec26884 100644--- a/app/Http/Controllers/BudgetController.php+++ b/app/Http/Controllers/BudgetController.php@@ -29,8 +29,10 @@ class BudgetController extends Controller*/public function __construct(){+ parent::__construct();View::share('title', 'Budgets');View::share('mainTitleIcon', 'fa-tasks');+ View::share('hideBudgets', true);}/**@@ -185,12 +187,11 @@ class BudgetController extends Controllerreturn view('error')->with('message', 'Invalid selection.');}- $hideBudget = true; // used in transaction list.- $journals = $repository->getJournals($budget, $repetition);- $limits = !is_null($repetition->id) ? [$repetition->budgetLimit] : $repository->getBudgetLimits($budget);- $subTitle = !is_null($repetition->id) ? e($budget->name) . ' in ' . $repetition->startdate->format('F Y') : e($budget->name);+ $journals = $repository->getJournals($budget, $repetition);+ $limits = !is_null($repetition->id) ? [$repetition->budgetLimit] : $repository->getBudgetLimits($budget);+ $subTitle = !is_null($repetition->id) ? e($budget->name) . ' in ' . $repetition->startdate->format('F Y') : e($budget->name);- return view('budgets.show', compact('limits', 'budget', 'repetition', 'journals', 'subTitle', 'hideBudget'));+ return view('budgets.show', compact('limits', 'budget', 'repetition', 'journals', 'subTitle'));}/**diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.phpindex 09b7b1370d..0225cdb0a1 100644--- a/app/Http/Controllers/CategoryController.php+++ b/app/Http/Controllers/CategoryController.php@@ -26,6 +26,7 @@ class CategoryController extends Controller*/public function __construct(){+ parent::__construct();View::share('title', 'Categories');View::share('mainTitleIcon', 'fa-bar-chart');}diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.phpindex fb7b363590..1af8d4b562 100644--- a/app/Http/Controllers/Controller.php+++ b/app/Http/Controllers/Controller.php@@ -3,6 +3,7 @@use Illuminate\Foundation\Bus\DispatchesCommands;use Illuminate\Foundation\Validation\ValidatesRequests;use Illuminate\Routing\Controller as BaseController;+use View;/*** Class Controller@@ -14,4 +15,14 @@ abstract class Controller extends BaseControlleruse DispatchesCommands, ValidatesRequests;+ /**+ *+ */+ public function __construct()+ {+ View::share('hideBudgets', false);+ View::share('hideCategories', false);+ View::share('hideBills', false);+ View::share('hideTags', false);+ }}diff --git a/app/Http/Controllers/CurrencyController.php b/app/Http/Controllers/CurrencyController.phpindex c0b2fd4258..33e100ca6d 100644--- a/app/Http/Controllers/CurrencyController.php+++ b/app/Http/Controllers/CurrencyController.php@@ -27,7 +27,7 @@ class CurrencyController extends Controller*/public function __construct(){-+ parent::__construct();View::share('title', 'Currencies');View::share('mainTitleIcon', 'fa-usd');}diff --git a/app/Http/Controllers/HelpController.php b/app/Http/Controllers/HelpController.phpindex 414e015944..d8072669a8 100644--- a/app/Http/Controllers/HelpController.php+++ b/app/Http/Controllers/HelpController.php@@ -1,12 +1,8 @@<?php namespace FireflyIII\Http\Controllers;-use Cache;-use ErrorException;use FireflyIII\Helpers\Help\HelpInterface;-use League\CommonMark\CommonMarkConverter;use Log;use Response;-use Route;/*** Class HelpControllerdiff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.phpindex d7728b61b1..bdaf16b314 100644--- a/app/Http/Controllers/HomeController.php+++ b/app/Http/Controllers/HomeController.php@@ -86,7 +86,7 @@ class HomeController extends Controller}}- return view('index', compact('count', 'title', 'savings', 'subTitle', 'mainTitleIcon', 'transactions', 'savingsTotal','piggyBankAccounts'));+ return view('index', compact('count', 'title', 'savings', 'subTitle', 'mainTitleIcon', 'transactions', 'savingsTotal', 'piggyBankAccounts'));}diff --git a/app/Http/Controllers/JsonController.php b/app/Http/Controllers/JsonController.phpindex 0b0ba06038..a58356cfd7 100644--- a/app/Http/Controllers/JsonController.php+++ b/app/Http/Controllers/JsonController.php@@ -1,7 +1,6 @@<?php namespace FireflyIII\Http\Controllers;use Amount;-use Auth;use Carbon\Carbon;use FireflyIII\Helpers\Report\ReportQueryInterface;use FireflyIII\Models\Account;@@ -188,7 +187,7 @@ class JsonController extends Controller*/public function tags(TagRepositoryInterface $tagRepository){- $list = $tagRepository->get();+ $list = $tagRepository->get();$return = [];foreach ($list as $entry) {$return[] = $entry->tag;diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.phpindex 82960a5dc9..ffd878d59f 100644--- a/app/Http/Controllers/PiggyBankController.php+++ b/app/Http/Controllers/PiggyBankController.php@@ -32,6 +32,7 @@ class PiggyBankController extends Controller*/public function __construct(){+ parent::__construct();View::share('title', 'Piggy banks');View::share('mainTitleIcon', 'fa-sort-amount-asc');}diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.phpindex 7df980e19f..84d2901104 100644--- a/app/Http/Controllers/PreferencesController.php+++ b/app/Http/Controllers/PreferencesController.php@@ -20,7 +20,7 @@ class PreferencesController extends Controller*/public function __construct(){-+ parent::__construct();View::share('title', 'Preferences');View::share('mainTitleIcon', 'fa-gear');}diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.phpindex 2c61ff4bdd..227ca9fbe4 100644--- a/app/Http/Controllers/ProfileController.php+++ b/app/Http/Controllers/ProfileController.php@@ -49,7 +49,8 @@ class ProfileController extends Controller/****/- public function postDeleteAccount(DeleteAccountFormRequest $request) {+ public function postDeleteAccount(DeleteAccountFormRequest $request)+ {// old, new1, new2if (!Hash::check($request->get('password'), Auth::user()->password)) {Session::flash('error', 'Invalid password!');@@ -60,11 +61,11 @@ class ProfileController extends Controller// DELETE!Auth::user()->delete();Session::flush();+return Redirect::route('index');}-/*** @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View*/diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.phpindex 2c0a46e271..990dd0a84d 100644--- a/app/Http/Controllers/TagController.php+++ b/app/Http/Controllers/TagController.php@@ -10,11 +10,11 @@ use FireflyIII\Models\Tag;use FireflyIII\Repositories\Tag\TagRepositoryInterface;use Input;use Preferences;+use Redirect;use Response;use Session;-use View;use URL;-use Redirect;+use View;/*** Class TagController@@ -31,7 +31,7 @@ class TagController extends Controller*/public function __construct(){-+ parent::__construct();View::share('title', 'Tags');View::share('mainTitleIcon', 'fa-tags');$tagOptions = [@@ -182,7 +182,7 @@ class TagController extends Controller];$repository->store($data);- Session::flash('success','The tag has been created!');+ Session::flash('success', 'The tag has been created!');if (intval(Input::get('create_another')) === 1) {// set value so create routine will not overwrite URL:@@ -199,7 +199,8 @@ class TagController extends Controller/*** @param Tag $tag*/- public function update(Tag $tag, TagFormRequest $request, TagRepositoryInterface $repository) {+ public function update(Tag $tag, TagFormRequest $request, TagRepositoryInterface $repository)+ {if (Input::get('setTag') == 'true') {$latitude = strlen($request->get('latitude')) > 0 ? $request->get('latitude') : null;$longitude = strlen($request->get('longitude')) > 0 ? $request->get('longitude') : null;diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.phpindex 87051ad93a..dc777ba086 100644--- a/app/Http/Controllers/TransactionController.php+++ b/app/Http/Controllers/TransactionController.php@@ -28,6 +28,7 @@ class TransactionController extends Controller*/public function __construct(){+ parent::__construct();View::share('title', 'Transactions');View::share('mainTitleIcon', 'fa-repeat');}@@ -162,7 +163,7 @@ class TransactionController extends Controller$preFilled['account_from_id'] = $transactions[1]->account->id;$preFilled['account_to_id'] = $transactions[0]->account->id;- Session::flash('preFilled',$preFilled);+ Session::flash('preFilled', $preFilled);// put previous url in session if not redirect from store (not "return_to_edit").if (Session::get('transactions.edit.fromUpdate') !== true) {diff --git a/resources/views/list/journals-full.blade.php b/resources/views/list/journals-full.blade.phpindex c44921e135..239e1b4642 100644--- a/resources/views/list/journals-full.blade.php+++ b/resources/views/list/journals-full.blade.php@@ -9,13 +9,18 @@<th>Date</th><th>From</th><th>To</th>- @if(!isset($hideBudget) || (isset($hideBudget) && $hideBudget=== false))+ {{-- Hide budgets? --}}+ @if($hideBudgets)<th><i class="fa fa-tasks fa-fw" title="Budget"></i></th>@endif- @if(!isset($hideCategory) || (isset($hideCategory) && $hideCategory=== false))++ {{-- Hide categories? --}}+ @if($hideCategories)<th><i class="fa fa-bar-chart fa-fw" title="Category"></i></th>@endif- @if(!isset($hideBill) || (isset($hideBill) && $hideBill=== false))++ {{-- Hide bills? --}}+ @if(!$hideBills)<th><i class="fa fa-fw fa-rotate-right" title="Bill"></i></th>@endif</tr>@@ -29,7 +34,7 @@</td><td> </td><td>{{{$journal->description}}}</td>- <td colspan="7"><em>Invalid journal: Found {{$journal->transactions()->count()}} transaction(s)</td>+ <td colspan="7"><em>Invalid journal: Found {{$journal->transactions()->count()}} transaction(s)</em></td></tr>@else<tr class="drag" data-date="{{$journal->date->format('Y-m-d')}}" data-id="{{$journal->id}}">@@ -60,14 +65,17 @@<a href="{{route('transactions.show',$journal->id)}}" title="{{{$journal->description}}}">{{{$journal->description}}}</a></td><td>- @if($journal->transactiontype->type == 'Withdrawal')+ @if(!$hideTags)+ {{-- If relevant, refer to tag instead of amount. --}}+ <!--+ transaction can only have one advancePayment or balancingAct.+ Other attempts to put in such a tag are blocked.+ also show an error when editing a tag and it becomes either+ of these two types. Or rather, block editing of the tag.+ -->+ {!! Amount::formatJournal($journal) !!}+ @else{!! Amount::formatJournal($journal) !!}- @endif- @if($journal->transactiontype->type == 'Deposit')- {!! Amount::formatJournal($journal) !!}- @endif- @if($journal->transactiontype->type == 'Transfer')- <span class="text-info">{{Amount::formatTransaction($journal->transactions[1],false)}}</span>@endif</td><td>@@ -87,7 +95,9 @@<a href="{{route('accounts.show',$journal->transactions[1]->account_id)}}">{{{$journal->transactions[1]->account->name}}}</a>@endif</td>- @if(!isset($hideBudget) || (isset($hideBudget) && $hideBudget=== false))++ {{-- Do NOT hide the budget? --}}+ @if(!$hideBudgets)<td><?php $budget = isset($journal->budgets[0]) ? $journal->budgets[0] : null; ?>@if($budget)@@ -95,20 +105,24 @@@endif</td>@endif- @if(!isset($hideCategory) || (isset($hideCategory) && $hideCategory=== false))- <td>- <?php $category = isset($journal->categories[0]) ? $journal->categories[0] : null; ?>- @if($category)- <a href="{{route('categories.show',$category->id)}}">{{{$category->name}}}</a>- @endif- </td>++ {{-- Do NOT hide the category? --}}+ @if(!$hideCategories)+ <td>+ <?php $category = isset($journal->categories[0]) ? $journal->categories[0] : null; ?>+ @if($category)+ <a href="{{route('categories.show',$category->id)}}">{{{$category->name}}}</a>+ @endif+ </td>@endif- @if(!isset($hideBill) || (isset($hideBill) && $hideBill=== false))- <td>- @if($journal->bill)- <a href="{{route('bills.show',$journal->bill_id)}}">{{{$journal->bill->name}}}</a>- @endif- </td>++ {{-- Do NOT hide the bill? --}}+ @if(!$hideBills)+ <td>+ @if($journal->bill)+ <a href="{{route('bills.show',$journal->bill_id)}}">{{{$journal->bill->name}}}</a>+ @endif+ </td>@endif