Hide accounts with no activity.

This commit is contained in:
James Cole
2015-03-27 13:39:12 +01:00
parent f7969afc22
commit a663ddb0d9

View File

@@ -60,15 +60,13 @@
$accountSums = [];
?>
@foreach($accounts as $account)
<th><a href="{{route('accounts.show',$account->id)}}">{{{$account->name}}}</a>
@if($account->hide === true)
<small>(hidden)</small>
@if($account->hide === false)
<th><a href="{{route('accounts.show',$account->id)}}">{{{$account->name}}}</a></th>
@endif
</th>
<?php
$accountSums[$account->id] = 0;
?>
@endforeach
<th colspan="2">
Left in budget
@@ -80,6 +78,7 @@
<td>{!! Amount::format($budget['amount']) !!}</td>
<?php $spent = 0;?>
@foreach($accounts as $account)
@if($account->hide === false)
@if(isset($account->budgetInformation[$id]))
<td>
@if($id == 0)
@@ -97,6 +96,7 @@
@else
<td>{!! Amount::format(0) !!}</td>
@endif
@endif
@endforeach
<td>{!! Amount::format($budget['amount'] + $budget['spent']) !!}</td>
<td>{!! Amount::format($budget['amount'] + $spent) !!}</td>
@@ -105,9 +105,11 @@
<tr>
<td colspan="2">Balanced by transfers</td>
@foreach($accounts as $account)
@if($account->hide === false)
<td>
<a href="{{route('reports.balanced-transfers',[$account, $year, $month])}}" class="openModal">{!! Amount::format($account->balancedAmount) !!}</a>
</td>
@endif
@endforeach
<td colspan="2">&nbsp;</td>
</tr>
@@ -117,6 +119,7 @@
<?php
$accountSums[$account->id] += $account->balancedAmount;
?>
@if($account->hide === false)
@if(isset($account->budgetInformation[0]))
<td>
@if($account->budgetInformation[0]['amount'] + $account->balancedAmount != 0.0)
@@ -128,20 +131,25 @@
@else
<td>{!! Amount::format(0) !!}</td>
@endif
@endif
@endforeach
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2"><em>Sum</em></td>
@foreach($accounts as $account)
@if($account->hide === false)
<td>{!! Amount::format($accountSums[$account->id]) !!}</td>
@endif
@endforeach
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2">Expected balance</td>
@foreach($accounts as $account)
@if($account->hide === false)
<td>{!! Amount::format($account->startBalance + $accountSums[$account->id]) !!}</td>
@endif
@endforeach
<td colspan="2">&nbsp;</td>
</tr>