mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-27 16:56:46 -06:00
Hide accounts with no activity in budget report.
This commit is contained in:
parent
52ce4cd313
commit
f7969afc22
@ -69,12 +69,16 @@ class ReportController extends Controller
|
|||||||
$budgets = $query->getBudgetSummary($account, $start, $end);
|
$budgets = $query->getBudgetSummary($account, $start, $end);
|
||||||
$balancedAmount = $query->balancedTransactionsSum($account, $start, $end);
|
$balancedAmount = $query->balancedTransactionsSum($account, $start, $end);
|
||||||
$array = [];
|
$array = [];
|
||||||
|
$hide = true;
|
||||||
foreach ($budgets as $budget) {
|
foreach ($budgets as $budget) {
|
||||||
$id = intval($budget->id);
|
$id = intval($budget->id);
|
||||||
$data = $budget->toArray();
|
$data = $budget->toArray();
|
||||||
$array[$id] = $data;
|
$array[$id] = $data;
|
||||||
|
if (floatval($data['amount']) != 0) {
|
||||||
|
$hide = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
$account->hide = $hide;
|
||||||
$account->budgetInformation = $array;
|
$account->budgetInformation = $array;
|
||||||
$account->balancedAmount = $balancedAmount;
|
$account->balancedAmount = $balancedAmount;
|
||||||
|
|
||||||
|
@ -60,7 +60,12 @@
|
|||||||
$accountSums = [];
|
$accountSums = [];
|
||||||
?>
|
?>
|
||||||
@foreach($accounts as $account)
|
@foreach($accounts as $account)
|
||||||
<th><a href="{{route('accounts.show',$account->id)}}">{{{$account->name}}}</a></th>
|
<th><a href="{{route('accounts.show',$account->id)}}">{{{$account->name}}}</a>
|
||||||
|
|
||||||
|
@if($account->hide === true)
|
||||||
|
<small>(hidden)</small>
|
||||||
|
@endif
|
||||||
|
</th>
|
||||||
<?php
|
<?php
|
||||||
$accountSums[$account->id] = 0;
|
$accountSums[$account->id] = 0;
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user