mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-07 06:31:22 +00:00
Extended budgets and limits [skip-ci]
This commit is contained in:
84
app/views/budgets/index-budget.blade.php
Normal file
84
app/views/budgets/index-budget.blade.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<table class="table table-bordered table-striped">
|
||||
<tr>
|
||||
<th>Budget</th>
|
||||
<th>Current envelope(s)</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
@foreach($budgets as $budget)
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{route('budgets.show',$budget->id)}}">{{{$budget->name}}}</a>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<small>Envelope</small>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<small>Left</small>
|
||||
</div>
|
||||
</div>
|
||||
@foreach($budget->limits as $limit)
|
||||
@foreach($limit->limitrepetitions as $index => $rep)
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<span class="label label-primary">
|
||||
<span class="glyphicon glyphicon-envelope"></span>
|
||||
{{mf($rep->amount,false)}}</span>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
@if($rep->left() < 0)
|
||||
<span class="label label-danger">
|
||||
<span class="glyphicon glyphicon-envelope"></span>
|
||||
{{mf($rep->left(),false)}}</span>
|
||||
@else
|
||||
<span class="label label-success">
|
||||
<span class="glyphicon glyphicon-envelope"></span>
|
||||
{{mf($rep->left(),false)}}</span>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<small>
|
||||
@if($limit->repeat_freq == 'monthly')
|
||||
{{$rep->startdate->format('F Y')}}
|
||||
@else
|
||||
NO FORMAT
|
||||
@endif
|
||||
</small>
|
||||
</div>
|
||||
@if($limit->repeats == 1)
|
||||
<div class="col-sm-2">
|
||||
<span class="label label-warning">auto repeats</span>
|
||||
</div>
|
||||
@endif
|
||||
<div class="col-sm-2 @if($limit->repeats == 0) col-sm-offset-2 @endif">
|
||||
<a href="#" class="btn btn-xs btn-default"><span class="glyphicon glyphicon-pencil"></span></a>
|
||||
@if($limit->repeats == 0 || ($limit->repeats == 1 && $index == 0))
|
||||
<a href="#" class="btn btn-xs btn-danger"><span class="glyphicon glyphicon-trash"></span></a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endforeach
|
||||
<p style="margin-top:5px;">
|
||||
<a href="{{route('budgets.limits.create',$budget->id)}}" class="btn btn-default btn-xs"><span
|
||||
class="glyphicon-plus-sign glyphicon"></span> Add another limit</a>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="#" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span></a>
|
||||
<a href="#" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span></a>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
43
app/views/budgets/index-date.blade.php
Normal file
43
app/views/budgets/index-date.blade.php
Normal file
@@ -0,0 +1,43 @@
|
||||
@foreach($reps as $date => $data)
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<h3>{{$data['date']}}</h3>
|
||||
<table class="table table-bordered table-striped">
|
||||
<tr>
|
||||
<th style="width:45%;">Budget</th>
|
||||
<th style="width:15%;">Envelope</th>
|
||||
<th style="width:15%;">Left</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
@foreach($data['limitrepetitions'] as $index => $rep)
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{route('budgets.show',$rep->limit->budget->id)}}">{{{$rep->limit->budget->name}}}</a>
|
||||
</td>
|
||||
<td>
|
||||
<span class="label label-primary">
|
||||
<span class="glyphicon glyphicon-envelope"></span> {{mf($rep->amount,false)}}</span>
|
||||
</td>
|
||||
<td>
|
||||
@if($rep->left() < 0)
|
||||
<span class="label label-danger">
|
||||
<span class="glyphicon glyphicon-envelope"></span>
|
||||
{{mf($rep->left(),false)}}</span>
|
||||
@else
|
||||
<span class="label label-success">
|
||||
<span class="glyphicon glyphicon-envelope"></span>
|
||||
{{mf($rep->left(),false)}}</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{route('budgets.limits.delete',$rep->limit->id)}}" class="btn btn-xs btn-danger"><span class="glyphicon glyphicon-trash"></span></a>
|
||||
@if($rep->limit->repeats == 1)
|
||||
<span class="label label-warning">auto repeats</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@@ -11,92 +11,19 @@
|
||||
budgets,
|
||||
which means that for each period of time (for example a month) a virtual "envelope" can be created
|
||||
containing a certain amount of money. Money spent within a budget is removed from the envelope.
|
||||
|
||||
</p>
|
||||
<p>
|
||||
@if($group == 'budget')
|
||||
<a class="btn btn-default" href ="{{route('budgets.index','date')}}"><span class="glyphicon glyphicon-th-list"></span> Group by date</a>
|
||||
@else
|
||||
<a class="btn btn-default" href ="{{route('budgets.index','budget')}}"><span class="glyphicon glyphicon-th-list"></span> Group by budget</a>
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<table class="table table-bordered table-striped">
|
||||
<tr>
|
||||
<th>Budget</th>
|
||||
<th>Current envelope(s)</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
@foreach($budgets as $budget)
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{route('budgets.show',$budget->id)}}">{{{$budget->name}}}</a>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<small>Envelope</small>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<small>Left</small>
|
||||
</div>
|
||||
</div>
|
||||
@foreach($budget->limits as $limit)
|
||||
@foreach($limit->limitrepetitions as $index => $rep)
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<span class="label label-primary">
|
||||
<span class="glyphicon glyphicon-envelope"></span>
|
||||
{{mf($rep->amount,false)}}</span>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
@if($rep->left() < 0)
|
||||
<span class="label label-danger">
|
||||
<span class="glyphicon glyphicon-envelope"></span>
|
||||
{{mf($rep->left(),false)}}</span>
|
||||
@else
|
||||
<span class="label label-success">
|
||||
<span class="glyphicon glyphicon-envelope"></span>
|
||||
{{mf($rep->left(),false)}}</span>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<small>
|
||||
@if($limit->repeat_freq == 'monthly')
|
||||
{{$rep->startdate->format('F Y')}}
|
||||
@else
|
||||
NO FORMAT
|
||||
@endif
|
||||
</small>
|
||||
</div>
|
||||
@if($limit->repeats == 1)
|
||||
<div class="col-sm-2">
|
||||
<span class="label label-warning">auto repeats</span>
|
||||
</div>
|
||||
@endif
|
||||
<div class="col-sm-2 @if($limit->repeats == 0) col-sm-offset-2 @endif">
|
||||
<a href="#" class="btn btn-xs btn-default"><span class="glyphicon glyphicon-pencil"></span></a>
|
||||
@if($limit->repeats == 0 || ($limit->repeats == 1 && $index == 0))
|
||||
<a href="#" class="btn btn-xs btn-danger"><span class="glyphicon glyphicon-trash"></span></a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endforeach
|
||||
<p style="margin-top:5px;">
|
||||
<a href="{{route('budgets.limits.create',$budget->id)}}" class="btn btn-default btn-xs"><span
|
||||
class="glyphicon-plus-sign glyphicon"></span> Add another limit</a>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="#" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span></a>
|
||||
<a href="#" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span></a>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@if($group == 'budget')
|
||||
@include('budgets.index-budget')
|
||||
@else
|
||||
@include('budgets.index-date')
|
||||
@endif
|
||||
@stop
|
||||
@@ -19,7 +19,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{Form::open(['class' => 'form-horizontal','url' => route('limits.store')])}}
|
||||
{{Form::open(['class' => 'form-horizontal','url' => route('budgets.limits.store')])}}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-12 col-sm-6">
|
||||
|
||||
Reference in New Issue
Block a user