mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Alright for issue #6 a lot of things have been updated. Piggy banks can now be made "repeated" in a different form, viewed and edited; Firefly will properly trigger to make the "instances". Also the show-view is finished which doesn't do much but helps in seeing how it works. [skip ci]
This commit is contained in:
@@ -21,9 +21,9 @@
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="name" class="form-control" id="name" value="{{Input::old('name')}}" placeholder="Name">
|
||||
@if($errors->has('name'))
|
||||
<p class="text-danger">{{$errors->first('name')}}</p>
|
||||
<p class="text-danger">{{$errors->first('name')}}</p>
|
||||
@else
|
||||
<span class="help-block">For example: new bike, new camera</span>
|
||||
<span class="help-block">For example: new bike, new camera</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@@ -66,15 +66,15 @@
|
||||
@if($errors->has('targetdate'))
|
||||
<p class="text-danger">{{$errors->first('targetdate')}}</p>
|
||||
@else
|
||||
<span class="help-block">A dead line is needed to properly repeat this repeated expesnse.</span>
|
||||
<span class="help-block">A deadline is needed to properly repeat this repeated expesnse.</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('rep_times', 'Repeat every', ['class' => 'col-sm-4 control-label'])}}
|
||||
{{ Form::label('rep_every', 'Repeat every', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
<input type="number" step="1" min="1" value="{{Input::old('rep_times') ?: 1}}" style="width:50px;display:inline;" max="100" name="rep_times" class="form-control" />
|
||||
<input type="number" step="1" min="1" value="{{Input::old('rep_every') ?: 1}}" style="width:50px;display:inline;" max="100" name="rep_every" class="form-control" />
|
||||
|
||||
<select class="form-control" name="rep_length" style="width:150px;display: inline">
|
||||
@foreach($periods as $period)
|
||||
@@ -97,6 +97,19 @@
|
||||
|
||||
<h4>Optional fields</h4>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('startdate', 'Start date', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
<input type="date" name="startdate" value="{{Input::old('startdate') ?: date('Y-m-d')}}"
|
||||
class="form-control"/>
|
||||
@if($errors->has('startdate'))
|
||||
<p class="text-danger">{{$errors->first('startdate')}}</p>
|
||||
@else
|
||||
<span class="help-block">This date indicates when you start(ed) saving money for this piggy bank. This field defaults to today and you should keep it on today.</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('reminder', 'Remind you every', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
@@ -146,7 +159,7 @@
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-4 col-sm-8">
|
||||
<button type="submit" class="btn btn-default btn-success">Create the piggy bank</button>
|
||||
<button type="submit" class="btn btn-default btn-success">Create the repeated expense</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -29,11 +29,7 @@
|
||||
<div class="form-group">
|
||||
<div class="col-sm-8">
|
||||
<input type="submit" name="submit" value="Remove piggy bank" class="btn btn-danger" />
|
||||
@if(Input::get('from') == 'date')
|
||||
<a href="{{route('budgets.index')}}" class="btn-default btn">Cancel</a>
|
||||
@else
|
||||
<a href="{{route('budgets.index.budget')}}" class="btn-default btn">Cancel</a>
|
||||
@endif
|
||||
<a href="{{route('piggybanks.index')}}" class="btn-default btn">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
138
app/views/piggybanks/edit-piggybank.blade.php
Normal file
138
app/views/piggybanks/edit-piggybank.blade.php
Normal file
@@ -0,0 +1,138 @@
|
||||
@extends('layouts.default')
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<h1>Firefly
|
||||
<small>Edit piggy bank "{{{$piggybank->name}}}"</small>
|
||||
</h1>
|
||||
<p class="lead">Use piggy banks to save for a one-time goal.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{Form::open(['class' => 'form-horizontal','url' => route('piggybanks.update',$piggybank->id)])}}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-12 col-sm-6">
|
||||
<h4>Mandatory fields</h4>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-4 control-label">Name</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="name" class="form-control" id="name" value="{{Input::old('name') ?: $piggybank->name}}" placeholder="{{{$piggybank->name}}}">
|
||||
@if($errors->has('name'))
|
||||
<p class="text-danger">{{$errors->first('name')}}</p>
|
||||
@else
|
||||
<span class="help-block">For example: new bike, new camera</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="account_id" class="col-sm-4 control-label">
|
||||
Saving account
|
||||
</label>
|
||||
<div class="col-sm-8">
|
||||
{{Form::select('account_id',$accounts,Input::old('account_id') ?: $piggybank->account_id,['class' => 'form-control'])}}
|
||||
@if($errors->has('account_id'))
|
||||
<p class="text-danger">{{$errors->first('account_id')}}</p>
|
||||
@else
|
||||
<span class="help-block">Indicate on which account you've got your savings.</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('targetamount', 'Target amount', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">€</span>
|
||||
{{Form::input('number','targetamount', Input::old('targetamount') ?: $piggybank->targetamount, ['step' => 'any', 'min' => '1', 'class' => 'form-control'])}}
|
||||
</div>
|
||||
|
||||
@if($errors->has('targetamount'))
|
||||
<p class="text-danger">{{$errors->first('targetamount')}}</p>
|
||||
@else
|
||||
<span class="help-block">How much money do you need to save?</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-12 col-sm-6">
|
||||
<h4>Optional fields</h4>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('startdate', 'Start date', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
<input type="date" name="startdate" value="{{Input::old('startdate') ?: $piggybank->startdate->format('Y-m-d')}}"
|
||||
class="form-control"/>
|
||||
@if($errors->has('startdate'))
|
||||
<p class="text-danger">{{$errors->first('startdate')}}</p>
|
||||
@else
|
||||
<span class="help-block">This date indicates when you start(ed) saving money for this piggy bank. This field defaults to today and you should keep it on today.</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('targetdate', 'Target date', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
@if(is_null($piggybank->targetdate))
|
||||
<input type="date" name="targetdate" value="{{Input::old('targetdate') ?: ''}}"
|
||||
class="form-control"/>
|
||||
@else
|
||||
<input type="date" name="targetdate" value="{{Input::old('targetdate') ?: $piggybank->targetdate->format('Y-m-d')}}"
|
||||
class="form-control"/>
|
||||
@endif
|
||||
@if($errors->has('targetdate'))
|
||||
<p class="text-danger">{{$errors->first('targetdate')}}</p>
|
||||
@else
|
||||
<span class="help-block">If this piggy bank has a dead line, enter it here.</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('reminder', 'Remind you every', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
<input type="number" step="1" min="1" value="{{Input::old('reminder_skip') ?: $piggybank->reminder_skip}}" style="width:50px;display:inline;" max="100" name="reminder_skip" class="form-control" />
|
||||
|
||||
<select class="form-control" name="reminder" style="width:150px;display: inline">
|
||||
<option value="none" label="do not remind me">do not remind me</option>
|
||||
@foreach($periods as $period)
|
||||
@if($period == $piggybank->reminder)
|
||||
<option value="{{$period}}" label="{{$period}}" selected="selected">{{$period}}</option>
|
||||
@else
|
||||
<option value="{{$period}}" label="{{$period}}">{{$period}}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
@if($errors->has('reminder'))
|
||||
<p class="text-danger">{{$errors->first('reminder')}}</p>
|
||||
@else
|
||||
<span class="help-block">Enter a number and a period and Firefly will remind you to add money
|
||||
to this piggy bank every now and then.</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-12 col-sm-6">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-4 col-sm-8">
|
||||
<button type="submit" class="btn btn-default btn-success">Update the piggy bank</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{Form::close()}}
|
||||
@stop
|
||||
@section('scripts')
|
||||
<?php echo javascript_include_tag('piggybanks-create'); ?>
|
||||
@stop
|
||||
174
app/views/piggybanks/edit-repeated.blade.php
Normal file
174
app/views/piggybanks/edit-repeated.blade.php
Normal file
@@ -0,0 +1,174 @@
|
||||
@extends('layouts.default')
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<h1>Firefly
|
||||
<small>Edit repeated expense "{{{$piggybank->name}}}"</small>
|
||||
</h1>
|
||||
<p class="lead">Create repeated expenses to keep track of long-term planned expenses</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{Form::open(['class' => 'form-horizontal','url' => route('piggybanks.update',$piggybank->id)])}}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-12 col-sm-6">
|
||||
<h4>Mandatory fields</h4>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-4 control-label">Name</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="name" class="form-control" id="name" value="{{Input::old('name') ?: $piggybank->name}}" placeholder="Name">
|
||||
@if($errors->has('name'))
|
||||
<p class="text-danger">{{$errors->first('name')}}</p>
|
||||
@else
|
||||
<span class="help-block">For example: new bike, new camera</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="account_id" class="col-sm-4 control-label">
|
||||
Saving account
|
||||
</label>
|
||||
<div class="col-sm-8">
|
||||
{{Form::select('account_id',$accounts,Input::old('account_id') ?: $piggybank->account_id,['class' => 'form-control'])}}
|
||||
@if($errors->has('account_id'))
|
||||
<p class="text-danger">{{$errors->first('account_id')}}</p>
|
||||
@else
|
||||
<span class="help-block">Indicate on which account you've got your savings.</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('targetamount', 'Target amount', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">€</span>
|
||||
{{Form::input('number','targetamount', Input::old('targetamount') ?: $piggybank->targetamount, ['step' => 'any', 'min' => '1', 'class' => 'form-control'])}}
|
||||
</div>
|
||||
|
||||
@if($errors->has('targetamount'))
|
||||
<p class="text-danger">{{$errors->first('targetamount')}}</p>
|
||||
@else
|
||||
<span class="help-block">How much money do you need to save?</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('targetdate', 'Target date', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
<input type="date" name="targetdate" value="{{Input::old('targetdate') ?: $piggybank->targetdate->format('Y-m-d')}}"
|
||||
class="form-control"/>
|
||||
@if($errors->has('targetdate'))
|
||||
<p class="text-danger">{{$errors->first('targetdate')}}</p>
|
||||
@else
|
||||
<span class="help-block">A deadline is needed to properly repeat this repeated expesnse.</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('rep_every', 'Repeat every', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
<input type="number" step="1" min="1" value="{{Input::old('rep_every') ?: $piggybank->rep_every}}" style="width:50px;display:inline;" max="100" name="rep_every" class="form-control" />
|
||||
|
||||
<select class="form-control" name="rep_length" style="width:150px;display: inline">
|
||||
@foreach($periods as $period)
|
||||
@if($period == $piggybank->rep_length || Input::old('reminder') == $period)
|
||||
<option value="{{$period}}" label="{{$period}}" selected="selected">{{$period}}</option>
|
||||
@else
|
||||
<option value="{{$period}}" label="{{$period}}">{{$period}}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
@if($errors->has('rep_length'))
|
||||
<p class="text-danger">{{$errors->first('rep_length')}}</p>
|
||||
@else
|
||||
<span class="help-block">Something about every X years bla bla bla.</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-12 col-sm-6">
|
||||
|
||||
<h4>Optional fields</h4>
|
||||
<div class="form-group">
|
||||
{{ Form::label('startdate', 'Start date', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
<input type="date" name="startdate" value="{{Input::old('startdate') ?: $piggybank->startdate->format('Y-m-d')}}"
|
||||
class="form-control"/>
|
||||
@if($errors->has('startdate'))
|
||||
<p class="text-danger">{{$errors->first('startdate')}}</p>
|
||||
@else
|
||||
<span class="help-block">This date indicates when you start(ed) saving money for this piggy bank. This field defaults to today and you should keep it on today.</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('reminder', 'Remind you every', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
<input type="number" step="1" min="1" value="{{Input::old('reminder_skip') ?: $piggybank->reminder_skip}}" style="width:50px;display:inline;" max="100" name="reminder_skip" class="form-control" />
|
||||
|
||||
<select class="form-control" name="reminder" style="width:150px;display: inline">
|
||||
<option value="none" label="do not remind me">do not remind me</option>
|
||||
@foreach($periods as $period)
|
||||
@if($period == $piggybank->reminder)
|
||||
<option value="{{$period}}" label="{{$period}}" selected="selected">{{$period}}</option>
|
||||
@else
|
||||
<option value="{{$period}}" label="{{$period}}">{{$period}}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
@if($errors->has('reminder'))
|
||||
<p class="text-danger">{{$errors->first('reminder')}}</p>
|
||||
@else
|
||||
<span class="help-block">Enter a number and a period and Firefly will remind you to save money
|
||||
for this repeated expense every now and then.</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
<div class="form-group">
|
||||
{{ Form::label('targetdate', 'Target date', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
{{ Form::input('date','targetdate', Input::old('targetdate') ?: '', ['class'
|
||||
=> 'form-control']) }}
|
||||
@if($errors->has('targetdate'))
|
||||
<p class="text-danger">{{$errors->first('targetdate')}}</p>
|
||||
@else
|
||||
<span class="help-block">
|
||||
If you want to, set a target date. This will inform you how much money you should save to
|
||||
get to the target amount.
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-12 col-sm-6">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-4 col-sm-8">
|
||||
<button type="submit" class="btn btn-default btn-success">Update the repeated expense</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{Form::close()}}
|
||||
@stop
|
||||
@section('scripts')
|
||||
<?php echo javascript_include_tag('piggybanks-create'); ?>
|
||||
@stop
|
||||
@@ -1,105 +0,0 @@
|
||||
@extends('layouts.default')
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<h1>Firefly
|
||||
<small>Edit piggy bank "{{{$piggybank->name}}}"</small>
|
||||
</h1>
|
||||
<p class="lead">Use piggy banks to make saving money easier</p>
|
||||
<p class="text-info">
|
||||
Saving money is <em>hard</em>. Piggy banks allow you to group money
|
||||
from an account together. If you also set a target (and a target date) you
|
||||
can save towards your goals.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{Form::open(['class' => 'form-horizontal','url' => route('piggybanks.update')])}}
|
||||
{{Form::hidden('id',$piggybank->id)}}
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-12 col-sm-6">
|
||||
<h4>Mandatory fields</h4>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-4 control-label">Name</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="name" class="form-control" id="name" value="{{{Input::old('name') ?: $piggybank->name}}}" placeholder="Name">
|
||||
@if($errors->has('name'))
|
||||
<p class="text-danger">{{$errors->first('name')}}</p>
|
||||
@else
|
||||
<span class="help-block">For example: new bike, new camera</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('target', 'Target amount', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">€</span>
|
||||
{{Form::input('number','target', Input::old('target') ?: $piggybank->target, ['step' => 'any', 'min' => '1', 'class' => 'form-control'])}}
|
||||
</div>
|
||||
|
||||
@if($errors->has('target'))
|
||||
<p class="text-danger">{{$errors->first('target')}}</p>
|
||||
@else
|
||||
<span class="help-block">How much money do you need to save?</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="account_id" class="col-sm-4 control-label">
|
||||
Saving account
|
||||
</label>
|
||||
<div class="col-sm-8">
|
||||
{{Form::select('account_id',$accounts,Input::old('account_id') ?: $piggybank->account_id,['class' => 'form-control'])}}
|
||||
@if($errors->has('account_id'))
|
||||
<p class="text-danger">{{$errors->first('account_id')}}</p>
|
||||
@else
|
||||
<span class="help-block">Indicate on which account you've got your savings.</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-12 col-sm-6">
|
||||
<h4>Optional fields</h4>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('targetdate', 'Target date', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
{{ Form::input('date','targetdate', Input::old('targetdate') ?: $piggybank->targetdate, ['class'
|
||||
=> 'form-control']) }}
|
||||
@if($errors->has('targetdate'))
|
||||
<p class="text-danger">{{$errors->first('targetdate')}}</p>
|
||||
@else
|
||||
<span class="help-block">
|
||||
If you want to, set a target date. This will inform you how much money you should save to
|
||||
get to the target amount.
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-12 col-sm-6">
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-4 col-sm-8">
|
||||
<button type="submit" class="btn btn-default btn-success">Create the piggy bank</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{Form::close()}}
|
||||
|
||||
|
||||
@stop
|
||||
@@ -36,6 +36,46 @@
|
||||
<h3>Current piggy banks</h3>
|
||||
@if($countNonRepeating == 0)
|
||||
<p class="text-warning">No piggy banks found.</p>
|
||||
@else
|
||||
<table class="table table-bordered">
|
||||
@foreach($piggybanks as $piggyBank)
|
||||
@if($piggyBank->repeats == 0)
|
||||
<!-- display piggy bank -->
|
||||
<tr>
|
||||
<td>
|
||||
<h4><a href="{{route('piggybanks.show',$piggyBank->id)}}">{{{$piggyBank->name}}}</a></h4>
|
||||
<p>
|
||||
<!-- target amount -->
|
||||
Saving up to {{mf($piggyBank->targetamount)}}.
|
||||
<!-- currently saved -->
|
||||
Currently saved
|
||||
{{mf($piggyBank->currentRelevantRep()->currentamount)}}.
|
||||
|
||||
<!-- start date (if any) -->
|
||||
@if(!is_null($piggyBank->startdate))
|
||||
Start date: {{$piggyBank->currentRelevantRep()->startdate->format('d M Y')}}.
|
||||
@endif
|
||||
|
||||
<!-- target date (if any) -->
|
||||
@if(!is_null($piggyBank->targetdate))
|
||||
Target date: {{$piggyBank->currentRelevantRep()->targetdate->format('d M Y')}}.
|
||||
@endif
|
||||
|
||||
@if(!is_null($piggyBank->reminder))
|
||||
Next reminder: {{$piggyBank->nextReminderDate()->format('d M Y')}}
|
||||
@endif
|
||||
|
||||
</p>
|
||||
<div class="btn-group-xs btn-group">
|
||||
<a href="{{route('piggybanks.edit',$piggyBank->id)}}" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span></a>
|
||||
<a href="{{route('piggybanks.delete',$piggyBank->id)}}" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span></a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endif
|
||||
@endforeach
|
||||
</table>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
@@ -43,6 +83,45 @@
|
||||
<h3>Current repeated expenses</h3>
|
||||
@if($countRepeating == 0)
|
||||
<p class="text-warning">No repeated expenses found.</p>
|
||||
@else
|
||||
<table class="table table-bordered">
|
||||
@foreach($piggybanks as $repeated)
|
||||
@if($repeated->repeats == 1)
|
||||
<!-- display repeated expense -->
|
||||
<tr><td>
|
||||
<h4><a href="{{route('piggybanks.show',$repeated->id)}}">{{{$repeated->name}}}</a></h4>
|
||||
<p>
|
||||
<!-- target amount -->
|
||||
Saving up to {{mf($repeated->targetamount)}}.
|
||||
|
||||
<!-- currently saved -->
|
||||
Currently saved
|
||||
{{mf($piggyBank->currentRelevantRep()->currentamount)}}.
|
||||
|
||||
<!-- start date (if any) -->
|
||||
@if(!is_null($piggyBank->startdate))
|
||||
Start date: {{$piggyBank->currentRelevantRep()->startdate->format('d M Y')}}.
|
||||
@endif
|
||||
|
||||
<!-- target date (if any) -->
|
||||
@if(!is_null($piggyBank->targetdate))
|
||||
Target date: {{$piggyBank->currentRelevantRep()->targetdate->format('d M Y')}}.
|
||||
@endif
|
||||
|
||||
@if(!is_null($piggyBank->reminder))
|
||||
Next reminder: {{$piggyBank->nextReminderDate()->format('d M Y')}}
|
||||
@endif
|
||||
|
||||
|
||||
</p>
|
||||
<div class="btn-group-xs btn-group">
|
||||
<a href="{{route('piggybanks.edit',$repeated->id)}}" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span></a>
|
||||
<a href="{{route('piggybanks.delete',$repeated->id)}}" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span></a>
|
||||
</div>
|
||||
</td></tr>
|
||||
@endif
|
||||
@endforeach
|
||||
</table>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -5,14 +5,127 @@
|
||||
<h1>Firefly
|
||||
<small>Piggy bank "{{{$piggyBank->name}}}"</small>
|
||||
</h1>
|
||||
<p class="lead">Set targets and save money</p>
|
||||
<p class="text-info">
|
||||
Saving money is <em>hard</em>. Piggy banks allow you to group money
|
||||
from an account together. If you also set a target (and a target date) you
|
||||
can save towards your goals.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
<h3>Piggy bank info</h3>
|
||||
<table class="table table-bordered table-striped">
|
||||
<tr>
|
||||
<th>Field</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Type (repeats)</td>
|
||||
<td>
|
||||
@if($piggyBank->repeats == 1)
|
||||
Repeated expense
|
||||
@else
|
||||
Piggy bank
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>{{{$piggyBank->name}}} (#{{$piggyBank->id}})</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Account</td>
|
||||
<td><a href="{{route('accounts.show',$piggyBank->account_id)}}">{{{$piggyBank->account->name}}}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Target amount</td>
|
||||
<td>{{mf($piggyBank->targetamount)}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Start date</td>
|
||||
<td>
|
||||
@if(is_null($piggyBank->startdate))
|
||||
<em>No start date</em>
|
||||
@else
|
||||
{{$piggyBank->startdate->format('jS F Y')}}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Target date</td>
|
||||
<td>
|
||||
@if(is_null($piggyBank->targetdate))
|
||||
<em>No target date</em>
|
||||
@else
|
||||
{{$piggyBank->targetdate->format('jS F Y')}}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Repeats every</td>
|
||||
<td>
|
||||
@if(!is_null($piggyBank->rep_length))
|
||||
Every {{$piggyBank->rep_every}} {{$piggyBank->rep_length}}(s)
|
||||
@if(!is_null($piggyBank->rep_times))
|
||||
({{$piggyBank->rep_times}} times)
|
||||
@else
|
||||
(indefinitely)
|
||||
@endif
|
||||
@else
|
||||
<em>Does not repeat</em>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Reminder</td>
|
||||
<td>
|
||||
@if(is_null($piggyBank->reminder))
|
||||
<em>(no reminder)</em>
|
||||
@else
|
||||
Every {{$piggyBank->reminder_skip}} {{$piggyBank->reminder}}(s)
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
<h3>Piggy bank instances info</h3>
|
||||
@foreach($piggyBank->piggybankrepetitions()->orderBy('startdate')->get() as $rep)
|
||||
<table class="table table-bordered table-striped">
|
||||
<tr>
|
||||
<th style="width:50%;">Field</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ID</td>
|
||||
<td>#{{$rep->id}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Current amount</td>
|
||||
<td>{{mf($rep->currentamount)}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Start date</td>
|
||||
<td>
|
||||
@if(is_null($rep->startdate))
|
||||
<em>No start date</em>
|
||||
@else
|
||||
{{$rep->startdate->format('jS F Y')}}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Target date</td>
|
||||
<td>
|
||||
@if(is_null($rep->targetdate))
|
||||
<em>No target date</em>
|
||||
@else
|
||||
{{$rep->targetdate->format('jS F Y')}}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
|
||||
@section('scripts')
|
||||
|
||||
Reference in New Issue
Block a user