Hide accounts with no activity during a year.

This commit is contained in:
James Cole
2015-03-27 19:34:37 +01:00
parent 7f5a55dffb
commit 45bced7b34
3 changed files with 36 additions and 29 deletions

View File

@@ -155,9 +155,12 @@ class ReportHelper implements ReportHelperInterface
$end->endOfYear();
foreach ($accounts as $account) {
$startBalance = Steam::balance($account, $start);
$endBalance = Steam::balance($account, $end);
$report[] = [
'start' => Steam::balance($account, $start),
'end' => Steam::balance($account, $end),
'start' => $startBalance,
'end' => $endBalance,
'hide' => ($startBalance == 0 && $endBalance == 0),
'account' => $account,
'shared' => $account->accountRole == 'sharedAsset'
];

View File

@@ -13,6 +13,7 @@ use Preferences;
use Session;
use Steam;
use View;
use FireflyIII\Models\Preference;
/**
* Class ReportController
@@ -367,7 +368,7 @@ class ReportController extends Controller
} catch (Exception $e) {
return view('error')->with('message', 'Invalid date.');
}
/** @var Preference $pref */
$pref = Preferences::get('showSharedReports', false);
$showSharedReports = $pref->data;
$date = new Carbon('01-01-' . $year);

View File

@@ -54,17 +54,20 @@
$end += $balance['end'];
$diff += ($balance['end']-$balance['start']);
?>
@if($balance['hide'] === false)
<tr>
<td>
<a href="{{route('accounts.show',$balance['account']->id)}}">{{{$balance['account']->name}}}</a>
@if($balance['shared'])
<small><em>shared</em></small>
@endif
</td>
<td>{!! Amount::format($balance['start']) !!}</td>
<td>{!! Amount::format($balance['end']) !!}</td>
<td>{!! Amount::format($balance['end']-$balance['start']) !!}</td>
</tr>
@endif
@endforeach
<tr>
<td><em>Sum of sums</em></td>