mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Restore chart #1292
This commit is contained in:
@@ -94,7 +94,7 @@ class AccountController extends Controller
|
|||||||
$subTitle = trans('firefly.make_new_' . $what . '_account');
|
$subTitle = trans('firefly.make_new_' . $what . '_account');
|
||||||
$roles = [];
|
$roles = [];
|
||||||
foreach (config('firefly.accountRoles') as $role) {
|
foreach (config('firefly.accountRoles') as $role) {
|
||||||
$roles[$role] = strval(trans('firefly.account_role_' . $role));
|
$roles[$role] = (string)trans('firefly.account_role_' . $role);
|
||||||
}
|
}
|
||||||
|
|
||||||
// pre fill some data
|
// pre fill some data
|
||||||
@@ -345,7 +345,9 @@ class AccountController extends Controller
|
|||||||
if (AccountType::INITIAL_BALANCE === $account->accountType->type) {
|
if (AccountType::INITIAL_BALANCE === $account->accountType->type) {
|
||||||
return $this->redirectToOriginalAccount($account);
|
return $this->redirectToOriginalAccount($account);
|
||||||
}
|
}
|
||||||
|
$end = new Carbon;
|
||||||
$today = new Carbon;
|
$today = new Carbon;
|
||||||
|
$start = $this->repository->oldestJournalDate($account);
|
||||||
$subTitleIcon = config('firefly.subIconsByIdentifier.' . $account->accountType->type);
|
$subTitleIcon = config('firefly.subIconsByIdentifier.' . $account->accountType->type);
|
||||||
$page = (int)$request->get('page');
|
$page = (int)$request->get('page');
|
||||||
$pageSize = (int)Preferences::get('listPageSize', 50)->data;
|
$pageSize = (int)Preferences::get('listPageSize', 50)->data;
|
||||||
@@ -360,11 +362,12 @@ class AccountController extends Controller
|
|||||||
$collector->setAccounts(new Collection([$account]))->setLimit($pageSize)->setPage($page);
|
$collector->setAccounts(new Collection([$account]))->setLimit($pageSize)->setPage($page);
|
||||||
$transactions = $collector->getPaginatedJournals();
|
$transactions = $collector->getPaginatedJournals();
|
||||||
$transactions->setPath(route('accounts.show.all', [$account->id]));
|
$transactions->setPath(route('accounts.show.all', [$account->id]));
|
||||||
$showAll = true;
|
$chartUri = route('chart.account.period', [$account->id, $start->format('Y-m-d'), $end->format('Y-m-d')]);
|
||||||
|
$showAll = true;
|
||||||
|
|
||||||
return view(
|
return view(
|
||||||
'accounts.show',
|
'accounts.show',
|
||||||
compact('account', 'showAll', 'currency', 'today', 'periods', 'subTitleIcon', 'transactions', 'subTitle')
|
compact('account', 'showAll', 'currency', 'today', 'chartUri', 'periods', 'subTitleIcon', 'transactions', 'subTitle', 'start', 'end')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
public/js/ff/accounts/show.js
vendored
2
public/js/ff/accounts/show.js
vendored
@@ -33,8 +33,8 @@ var fixHelper = function (e, tr) {
|
|||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
lineChart(chartUri, 'overview-chart');
|
||||||
if (!showAll) {
|
if (!showAll) {
|
||||||
lineChart(chartUri, 'overview-chart');
|
|
||||||
pieChart(incomeCategoryUri, 'account-cat-in');
|
pieChart(incomeCategoryUri, 'account-cat-in');
|
||||||
pieChart(expenseCategoryUri, 'account-cat-out');
|
pieChart(expenseCategoryUri, 'account-cat-out');
|
||||||
pieChart(expenseBudgetUri, 'account-budget-out');
|
pieChart(expenseBudgetUri, 'account-budget-out');
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if not showAll %}
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
@@ -29,6 +29,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% if not showAll %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
|
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
@@ -153,10 +154,11 @@
|
|||||||
var showAll = true;
|
var showAll = true;
|
||||||
currencySymbol = "{{ currency.symbol }}";
|
currencySymbol = "{{ currency.symbol }}";
|
||||||
var accountID = {{ account.id }};
|
var accountID = {{ account.id }};
|
||||||
|
var chartUri = '{{ chartUri }}';
|
||||||
{% if not showAll %}
|
{% if not showAll %}
|
||||||
showAll = false;
|
showAll = false;
|
||||||
// uri's for charts:
|
// uri's for charts:
|
||||||
var chartUri = '{{ chartUri }}';
|
|
||||||
var incomeCategoryUri = '{{ route('chart.account.income-category', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';
|
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 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')]) }}';
|
var expenseBudgetUri = '{{ route('chart.account.expense-budget', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';
|
||||||
|
Reference in New Issue
Block a user