Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Some work on bread crumbs and reports.
James Cole0df6c3a8dcf7
diff --git a/app/breadcrumbs.php b/app/breadcrumbs.phpindex 0aff5d9441..9eaf34cd8b 100644--- a/app/breadcrumbs.php+++ b/app/breadcrumbs.php@@ -1,7 +1,26 @@<?php+use DaveJamesMiller\Breadcrumbs\Generator;+/** Back home.*/-Breadcrumbs::register('home', function($breadcrumbs) {- $breadcrumbs->push('Home', route('index'));-});\ No newline at end of file+Breadcrumbs::register(+ 'home',+ function (Generator $breadcrumbs) {++ $breadcrumbs->push('Home', route('index'));+ }+);++Breadcrumbs::register(+ 'accounts.index', function (Generator $breadcrumbs, $what) {+ $breadcrumbs->parent('home');+ $breadcrumbs->push(ucfirst($what) . ' accounts', route('accounts.index', $what));+ }+);+Breadcrumbs::register(+ 'accounts.show', function (Generator $breadcrumbs, $what, \Account $account) {+ $breadcrumbs->parent('accounts.index',$what);+ $breadcrumbs->push($account->name, route('accounts.show', $account->id));+ }+);\ No newline at end of filediff --git a/app/controllers/ReportController.php b/app/controllers/ReportController.phpindex 2ec832c34a..6583a95554 100644--- a/app/controllers/ReportController.php+++ b/app/controllers/ReportController.php@@ -1,6 +1,5 @@<?phpuse Carbon\Carbon;-use Illuminate\Support\Collection;/*** Class ReportController@@ -177,7 +176,7 @@ class ReportController extends BaseController*/$deposits = $journals->filter(function (TransactionJournal $journal) {- if ($journal->transactionType->type == 'Withdrawal' && count($journal->budgets) == 0) {+ if ($journal->transactionType->type == 'Deposit' && count($journal->budgets) == 0) {return $journal;}}@@ -220,22 +219,30 @@ class ReportController extends BaseController*/$deposits = $deposits->filter(function (TransactionJournal $journal) {+ echo 'Now at #'.$journal->id.': '.$journal->description.'<br>';foreach ($journal->transactions as $transaction) {+if (floatval($transaction->amount) < 0) {$account = $transaction->account;// find counter transfer:- $counters = $account->transactions()->where('amount', floatval($transaction->amount))+ $counters = $account->transactions()->where('amount', floatval($transaction->amount) * -1)->where('account_id', '=', $transaction->account_id)->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')->where('transaction_journals.description', 'LIKE', '%' . e($journal->description) . '%')- ->count();- if($counters == 0) {+ ->get(['transactions.*']);+ /** @var Transaction $transaction */+ foreach($counters as $transaction) {+ echo 'Found possible counter: #'.$transaction->transaction_journal_id.': '.$transaction->transactionJournal->description.'<br>';+ }+ if($counters->count() == 0) {return $journal;}}}+ echo '<br>';});+ exit;return View::make('reports.unbalanced', compact('start', 'end', 'title', 'subTitle', 'subTitleIcon', 'mainTitleIcon', 'withdrawals','deposits'));}