mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-11 00:16:54 +00:00
Expand piggy banks
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
<table class="table table-bordered table-striped">
|
||||
<tr>
|
||||
@if(isset($showPiggybank) && $showPiggybank === true)
|
||||
<th>Piggy bank</th>
|
||||
@endif
|
||||
<th>Date</th>
|
||||
<th>Amount</th>
|
||||
</tr>
|
||||
@foreach($events as $event)
|
||||
<tr>
|
||||
@if(isset($showPiggybank) && $showPiggybank === true)
|
||||
<td>
|
||||
<a href="{{route('piggybanks.show',$event->piggybank_id)}}">{{{$event->piggybank->name}}}</a>
|
||||
</td>
|
||||
@endif
|
||||
<td>
|
||||
@if(!is_null($event->transaction_journal_id))
|
||||
<a href="{{route('transactions.show',$event->transaction_journal_id)}}" title="{{{$event->transactionJournal->description}}}">{{$event->date->format('j F Y')}}</a>
|
||||
|
||||
@@ -2,71 +2,93 @@
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
<h3>Metadata</h3>
|
||||
<table class="table table-striped table-bordered">
|
||||
<tr>
|
||||
<td>Date</td>
|
||||
<td>{{{$journal->date->format('jS F Y')}}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Currency</td>
|
||||
<td>{{{$journal->transactioncurrency->code}}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Type</td>
|
||||
<td>{{{$journal->transactiontype->type}}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Completed</td>
|
||||
<td>
|
||||
@if($journal->completed == 1)
|
||||
<span class="text-success">Yes</span>
|
||||
@else
|
||||
<span class="text-danger">No</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@foreach($journal->budgets()->get() as $budget)
|
||||
<tr>
|
||||
<td>{{$budget->class}}</td>
|
||||
<td><a href="{{route('budgets.show',$budget->id)}}">{{{$budget->name}}}</a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@foreach($journal->categories()->get() as $category)
|
||||
<tr>
|
||||
<td>{{$category->class}}</td>
|
||||
<td><a href="{{route('categories.show',$category->id)}}">{{{$category->name}}}</a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Metadata
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<table class="table table-striped table-bordered">
|
||||
<tr>
|
||||
<td>Date</td>
|
||||
<td>{{{$journal->date->format('jS F Y')}}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Currency</td>
|
||||
<td>{{{$journal->transactioncurrency->code}}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Type</td>
|
||||
<td>{{{$journal->transactiontype->type}}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Completed</td>
|
||||
<td>
|
||||
@if($journal->completed == 1)
|
||||
<span class="text-success">Yes</span>
|
||||
@else
|
||||
<span class="text-danger">No</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@foreach($journal->budgets()->get() as $budget)
|
||||
<tr>
|
||||
<td>{{$budget->class}}</td>
|
||||
<td><a href="{{route('budgets.show',$budget->id)}}">{{{$budget->name}}}</a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@foreach($journal->categories()->get() as $category)
|
||||
<tr>
|
||||
<td>{{$category->class}}</td>
|
||||
<td><a href="{{route('categories.show',$category->id)}}">{{{$category->name}}}</a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</table>
|
||||
<!-- TODO show related piggy bank -->
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- events, if present -->
|
||||
@if(count($journal->piggybankevents) > 0)
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Piggy banks
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
@include('list.piggybank-events',['events' => $journal->piggybankevents,'showPiggybank' => true])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
<h3>Transactions</h3>
|
||||
@foreach($journal->transactions as $t)
|
||||
<h4><a href="{{route('accounts.show',$t->account->id)}}">{{{$t->account->name}}}</a><br /><small>{{{$t->account->accounttype->description}}}</small></h4>
|
||||
<table class="table table-striped table-bordered">
|
||||
<tr>
|
||||
<td>Amount</td>
|
||||
<td>{{mf($t->amount)}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>New balance</td>
|
||||
<td>{{mf($t->account->balanceBeforeJournal($journal))}} → {{mf($t->account->balanceBeforeJournal($journal) + $t->amount)}}</td>
|
||||
</tr>
|
||||
@if(!is_null($t->description))
|
||||
<tr>
|
||||
<td>Description</td>
|
||||
<td>{{{$t->description}}}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
@endforeach
|
||||
|
||||
@foreach($journal->transactions as $t)
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<a href="{{route('accounts.show',$t->account->id)}}">{{{$t->account->name}}}</a><br /><small>{{{$t->account->accounttype->description}}}</small>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<table class="table table-striped table-bordered">
|
||||
<tr>
|
||||
<td>Amount</td>
|
||||
<td>{{mf($t->amount)}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>New balance</td>
|
||||
<td>{{mf($t->account->balanceBeforeJournal($journal))}} → {{mf($t->account->balanceBeforeJournal($journal) + $t->amount)}}</td>
|
||||
</tr>
|
||||
@if(!is_null($t->description))
|
||||
<tr>
|
||||
<td>Description</td>
|
||||
<td>{{{$t->description}}}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
<div class="btn-group">
|
||||
|
||||
Reference in New Issue
Block a user