Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Better view for accounts and I fixed a html error.
James Cole7e0ef6d43e61
diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.phpindex 9fc18dc35d..28c9726917 100644--- a/app/Http/Controllers/AccountController.php+++ b/app/Http/Controllers/AccountController.php@@ -248,7 +248,7 @@ class AccountController extends Controller// generate entries for each period (and cache those)$entries = $this->periodEntries($account);- return view('accounts.show', compact('account', 'what', 'entries', 'subTitleIcon', 'journals', 'subTitle', 'start', 'end', 'chartUri'));+ return view('accounts.show', compact('account', 'entries', 'subTitleIcon', 'journals', 'subTitle', 'start', 'end', 'chartUri'));}/**@@ -274,7 +274,8 @@ class AccountController extends Controller$start = $repository->oldestJournalDate($account);$end = $repository->newestJournalDate($account);- return view('accounts.show-by-date', compact('account', 'journals', 'subTitle', 'start', 'end','chartUri'));+ // same call, except "entries".+ return view('accounts.show', compact('account', 'subTitleIcon', 'journals', 'subTitle', 'start', 'end', 'chartUri'));}/**@@ -300,7 +301,8 @@ class AccountController extends Controller$journals = $collector->getPaginatedJournals();$journals->setPath('accounts/show/' . $account->id . '/' . $date);- return view('accounts.show-by-date', compact('category', 'date', 'account', 'journals', 'subTitle', 'carbon', 'start', 'end','chartUri'));+ // same call, except "entries".+ return view('accounts.show', compact('account', 'subTitleIcon', 'journals', 'subTitle', 'start', 'end', 'chartUri'));}/**diff --git a/app/Http/breadcrumbs.php b/app/Http/breadcrumbs.phpindex 8e70cd9dd7..0e960d730d 100644--- a/app/Http/breadcrumbs.php+++ b/app/Http/breadcrumbs.php@@ -67,30 +67,34 @@ Breadcrumbs::register(Breadcrumbs::register('accounts.show', function (BreadCrumbGenerator $breadcrumbs, Account $account) {- $what = config('firefly.shortNamesByFullName.' . $account->accountType->type);+ $what = config('firefly.shortNamesByFullName.' . $account->accountType->type);+$breadcrumbs->parent('accounts.index', $what);- $breadcrumbs->push(e($account->name), route('accounts.show', [$account->id]));+ $breadcrumbs->push($account->name, route('accounts.show', [$account->id]));});Breadcrumbs::register(- 'accounts.show.date', function (BreadCrumbGenerator $breadcrumbs, Account $account, Carbon $date) {- $breadcrumbs->parent('accounts.show', $account);+ 'accounts.show.date', function (BreadCrumbGenerator $breadcrumbs, Account $account, Carbon $start, Carbon $end) {- $range = Preferences::get('viewRange', '1M')->data;- $title = $account->name . ' (' . Navigation::periodShow($date, $range) . ')';+ $startString = $start->formatLocalized(strval(trans('config.month_and_day')));+ $endString = $end->formatLocalized(strval(trans('config.month_and_day')));+ $title = sprintf('%s (%s)', $account->name, trans('firefly.from_to', ['start' => $startString, 'end' => $endString]));- $breadcrumbs->push($title, route('accounts.show.date', [$account->id, $date->format('Y-m-d')]));+ $breadcrumbs->parent('accounts.show', $account);+ $breadcrumbs->push($title, route('accounts.show.date', [$account->id, $start->format('Y-m-d')]));});Breadcrumbs::register(- 'accounts.show.all', function (BreadCrumbGenerator $breadcrumbs, Account $account) {- $breadcrumbs->parent('accounts.show', $account);+ 'accounts.show.all', function (BreadCrumbGenerator $breadcrumbs, Account $account, Carbon $start, Carbon $end) {- $title = sprintf('%s (%s)', $account->name, strtolower(trans('firefly.everything')));+ $startString = $start->formatLocalized(strval(trans('config.month_and_day')));+ $endString = $end->formatLocalized(strval(trans('config.month_and_day')));+ $title = sprintf('%s (%s)', $account->name, trans('firefly.from_to', ['start' => $startString, 'end' => $endString]));- $breadcrumbs->push($title, route('accounts.show.all', [$account->id]));+ $breadcrumbs->parent('accounts.show', $account);+ $breadcrumbs->push($title, route('accounts.show.all', [$account->id, $start->format('Y-m-d')]));});diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.phpindex 1781cfc683..cec77e6586 100644--- a/resources/lang/en_US/firefly.php+++ b/resources/lang/en_US/firefly.php@@ -526,6 +526,7 @@ return ['select_more_than_one_account' => 'Please select more than one account','select_more_than_one_category' => 'Please select more than one category','select_more_than_one_budget' => 'Please select more than one budget',+ 'from_to' => 'From :start to :end',// categories:'new_category' => 'New category',diff --git a/resources/views/accounts/show-by-date.twig b/resources/views/accounts/show-by-date.twigdeleted file mode 100644index bc298b3be1..0000000000--- a/resources/views/accounts/show-by-date.twig+++ /dev/null@@ -1,110 +0,0 @@-{% extends "./layout/default" %}--{% block breadcrumbs %}-- {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, account, carbon) }}-{% endblock %}--{% block content %}-- <div class="row">- <div class="col-lg-12 col-md-12 col-sm-12">- <div class="box">- <div class="box-header with-border">- <h3 class="box-title">{{ 'overview'|_ }} (period)</h3>-- <!-- ACTIONS MENU -->- <div class="box-tools pull-right">- <div class="btn-group">- <button class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown"><i class="fa fa-ellipsis-v"></i></button>- <ul class="dropdown-menu" role="menu">- <li><a href="{{ route('accounts.edit', account.id) }}"><i class="fa fa-pencil fa-fw"></i> {{ 'edit'|_ }}</a></li>- <li><a href="{{ route('accounts.delete', account.id) }}"><i class="fa fa-trash fa-fw"></i> {{ 'delete'|_ }}</a></li>- </ul>- </div>- </div>-- </div>- <div class="box-body">- <canvas id="overview-chart" style="width:100%;height:350px;" height="350"></canvas>- </div>- </div>- </div>- </div>-- <div class="row">- <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">- <div class="box">- <div class="box-header with-border">- <h3 class="box-title">{{ 'expenses_by_category'|_ }}</h3>- </div>- <div class="box-body">- <div style="width:60%;margin:0 auto;">- <canvas id="account-cat-out" style="margin:0 auto;" height="150" width="150"></canvas>- </div>- </div>- </div>- </div>- <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">- <div class="box">- <div class="box-header with-border">- <h3 class="box-title">{{ 'expenses_by_budget'|_ }}</h3>- </div>- <div class="box-body">- <div style="width:60%;margin:0 auto;">- <canvas id="account-budget-out" style="margin:0 auto;" height="150" width="150"></canvas>- </div>- </div>- </div>- </div>- <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">- <div class="box">- <div class="box-header with-border">- <h3 class="box-title">{{ 'income_by_category'|_ }}</h3>- </div>- <div class="box-body">- <div style="width:60%;margin:0 auto;">- <canvas id="account-cat-in" style="margin:0 auto;" height="150" width="150"></canvas>- </div>- </div>- </div>- </div>- </div>-- <div class="row">- <div class="col-lg-12 col-md-12 col-sm-12">- <div class="box">- <div class="box-header with-border">- <h3 class="box-title">{{ 'transactions'|_ }}</h3>- </div>- <div class="box-body">- {% include 'list.journals-tasker' with {sorting:true} %}- </div>- </div>- </div>- </div>----{% endblock %}--{% block scripts %}- <script type="text/javascript">- var accountID = {{ account.id }};- var dateString = "{{ date|escape }}";-- // uri's for charts:- var chartUri = '{{ chartUri }}';- var incomeCategoryUri = '{{ route('chart.account.income-category', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';- var expenseCategoryUri = '{{ route('chart.account.expense-category', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';- var expenseBudgetUri = '{{ route('chart.account.expense-budget', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';-- </script>- <script type="text/javascript" src="js/lib/Chart.bundle.min.js"></script>- <script type="text/javascript" src="js/ff/charts.defaults.js"></script>- <script type="text/javascript" src="js/ff/charts.js"></script>- <script src="js/lib/jquery-ui.min.js" type="text/javascript"></script>- <script src="js/lib/jquery.color-2.1.2.min.js" type="text/javascript"></script>- <script src="js/ff/accounts/show.js" type="text/javascript"></script>- <script type="text/javascript" src="js/ff/transactions/list.js"></script>-{% endblock %}diff --git a/resources/views/accounts/show.twig b/resources/views/accounts/show.twigindex 6b37740fe5..42068245e4 100644--- a/resources/views/accounts/show.twig+++ b/resources/views/accounts/show.twig@@ -1,7 +1,7 @@{% extends "./layout/default" %}{% block breadcrumbs %}- {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, account) }}+ {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, account, start, end) }}{% endblock %}{% block content %}@@ -9,7 +9,8 @@<div class="col-lg-12 col-md-10 col-sm-12"><div class="box"><div class="box-header with-border">- <h3 class="box-title">{{ account.name }}</h3>+ <h3 class="box-title">{{ account.name }}+ ({{ trans('firefly.from_to', {start: start.formatLocalized(monthAndDayFormat), end: end.formatLocalized(monthAndDayFormat)}) }})</h3><!-- ACTIONS MENU --><div class="box-tools pull-right">@@ -68,7 +69,7 @@</div><div class="row">- <div class="col-lg-10 col-md-10 col-sm-12">+ <div class="{% if entries %}col-lg-10 col-md-10 col-sm-12{% else %}col-lg-12 col-md-12 col-sm-12{% endif %}"><div class="box"><div class="box-header with-border"><h3 class="box-title">{{ 'transactions'|_ }}</h3>@@ -84,35 +85,37 @@</div></div></div>- <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">- {% for entry in entries %}- {% if entry[2] != 0 or entry[3] != 0 %}- <div class="box">- <div class="box-header with-border">- <h3 class="box-title"><a href="{{ route('accounts.show.date',[account.id,entry[0]]) }}">{{ entry[1] }}</a>- </h3>+ {% if entries %}+ <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">+ {% for entry in entries %}+ {% if entry[2] != 0 or entry[3] != 0 %}+ <div class="box">+ <div class="box-header with-border">+ <h3 class="box-title"><a href="{{ route('accounts.show.date',[account.id,entry[0]]) }}">{{ entry[1] }}</a>+ </h3>+ </div>+ <div class="box-body no-padding">+ <table class="table table-hover">+ {% if entry[2] != 0 %}+ <tr>+ <td colspan="33%">{{ 'spent'|_ }}</td>+ <td colspan="67%">{{ entry[2]|formatAmount }}</td>+ </tr>+ {% endif %}+ {% if entry[3] != 0 %}+ <tr>+ <td colspan="33%">{{ 'earned'|_ }}</td>+ <td colspan="67%">{{ entry[3]|formatAmount }}</td>+ </tr>+ {% endif %}+ </table>+ </div></div>- <div class="box-body no-padding">- <table class="table table-hover">- {% if entry[2] != 0 %}- <tr>- <td colspan="33%">{{ 'spent'|_ }}</td>- <td colspan="67%">{{ entry[2]|formatAmount }}</td>- </tr>- {% endif %}- {% if entry[3] != 0 %}- <tr>- <td colspan="33%">{{ 'earned'|_ }}</td>- <td colspan="67%">{{ entry[3]|formatAmount }}</td>- </tr>- {% endif %}- </table>- </div>- </div>- {% endif %}+ {% endif %}- {% endfor %}- </div>+ {% endfor %}+ </div>+ {% endif %}</div>diff --git a/resources/views/categories/show.twig b/resources/views/categories/show.twigindex 9ff1006823..92e130e683 100644--- a/resources/views/categories/show.twig+++ b/resources/views/categories/show.twig@@ -9,7 +9,7 @@<div class="col-lg-6 col-md-6 col-sm-12"><div class="box"><div class="box-header with-border">- <h3 class="box-title">{{ 'overview'|_ }} (month)</h3>+ <h3 class="box-title">{{ 'overview'|_ }} ({{ 'month'|_ }})</h3></div><div class="box-body"><canvas id="period" style="width:100%" height="350"></canvas>@@ -19,7 +19,7 @@<div class="col-lg-6 col-md-6 col-sm-12"><div class="box"><div class="box-header with-border">- <h3 class="box-title">{{ 'overview'|_ }} (all)</h3>+ <h3 class="box-title">{{ 'overview'|_ }} ({{ 'all'|_ }})</h3></div><div class="box-body"><canvas id="all" style="width:100%;" height="350"></canvas>diff --git a/resources/views/search/partials/tags.twig b/resources/views/search/partials/tags.twigindex 919fa19daf..fd4342c67b 100644--- a/resources/views/search/partials/tags.twig+++ b/resources/views/search/partials/tags.twig@@ -16,8 +16,8 @@</div></td><td data-value="{{ tag.tag }}">- <a href="{{ route('tags.show',tag.id) }}">{{ tag.tag }}</a><- /td>+ <a href="{{ route('tags.show',tag.id) }}">{{ tag.tag }}</a>+ </td><td>{{ ('tag'~tag.tagMode)|_ }}</td></tr>{% endfor %}