Varioux fixes and cleaning up.

This commit is contained in:
James Cole
2014-09-28 08:47:51 +02:00
parent 9015d6ca16
commit aa9eb8ca64
15 changed files with 949 additions and 628 deletions

View File

@@ -1,182 +1,186 @@
@extends('layouts.default')
@section('content')
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<p class="lead">Use recurring transactions to track repeated expenses</p>
<p class="text-info">
Bla bla.
</p>
</div>
</div>
{{Form::open(['class' => 'form-horizontal','url' => route('recurring.store')])}}
<div class="row">
<div class="col-lg-6 col-md-12 col-sm-6">
<h4>Mandatory fields</h4>
<!-- name -->
<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')}}" placeholder="Name">
@if($errors->has('name'))
<p class="text-danger">{{$errors->first('name')}}</p>
@else
<span class="help-block">For example: rent, gas, insurance</span>
@endif
<!-- panel for mandatory fields -->
<div class="panel panel-primary">
<div class="panel-heading">
<i class="fa fa-exclamation-circle"></i> Mandatory fields
</div>
</div>
<div class="form-group">
<label for="match" class="col-sm-4 control-label">Matches on</label>
<div class="col-sm-8">
<input type="text" name="match" class="form-control" id="match" value="{{Input::old('match')}}" data-role="tagsinput">
@if($errors->has('match'))
<p class="text-danger">{{$errors->first('match')}}</p>
@else
<span class="help-block">For example: rent, [company name]. All matches need to
be present for the recurring transaction to be recognized. This field is not case-sensitive. <em>Press enter after every match</em></span>
@endif
</div>
</div>
<div class="form-group">
{{ Form::label('amount_min', 'Minimum amount', ['class' => 'col-sm-4 control-label'])}}
<div class="col-sm-8">
<div class="input-group">
<span class="input-group-addon">&euro;</span>
{{Form::input('number','amount_min', Input::old('amount_min'), ['step' => 'any', 'class' => 'form-control'])}}
<div class="panel-body">
<!-- name -->
<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')}}" placeholder="Name">
@if($errors->has('name'))
<p class="text-danger">{{$errors->first('name')}}</p>
@endif
</div>
</div>
<div class="form-group">
<label for="match" class="col-sm-4 control-label">Matches on</label>
<div class="col-sm-8">
<input type="text" name="match" class="form-control" id="match" value="{{Input::old('match')}}" data-role="tagsinput">
@if($errors->has('match'))
<p class="text-danger">{{$errors->first('match')}}</p>
@endif
</div>
</div>
@if($errors->has('amount_min'))
<p class="text-danger">{{$errors->first('amount_min')}}</p>
@else
<span class="help-block">Firefly will only include transactions with a higher amount than this. If your rent
is usually around &euro; 500,-, enter <code>450</code> to be safe.</span>
@endif
</div>
</div>
<div class="form-group">
{{ Form::label('amount_min', 'Minimum amount', ['class' => 'col-sm-4 control-label'])}}
<div class="col-sm-8">
<div class="input-group">
<span class="input-group-addon">&euro;</span>
{{Form::input('number','amount_min', Input::old('amount_min'), ['step' => 'any', 'class' => 'form-control'])}}
</div>
<div class="form-group">
{{ Form::label('amount_max', 'Maximum amount', ['class' => 'col-sm-4 control-label'])}}
<div class="col-sm-8">
<div class="input-group">
<span class="input-group-addon">&euro;</span>
{{Form::input('number','amount_max', Input::old('amount_max'), ['step' => 'any', 'class' => 'form-control'])}}
@if($errors->has('amount_min'))
<p class="text-danger">{{$errors->first('amount_min')}}</p>
@endif
</div>
</div>
@if($errors->has('amount_max'))
<p class="text-danger">{{$errors->first('amount_max')}}</p>
@else
<span class="help-block">Firefly will only include transactions with a lower amount than this. If your rent
is usually around &euro; 500,-, enter <code>550</code> to be safe.</span>
@endif
<div class="form-group">
{{ Form::label('amount_max', 'Maximum amount', ['class' => 'col-sm-4 control-label'])}}
<div class="col-sm-8">
<div class="input-group">
<span class="input-group-addon">&euro;</span>
{{Form::input('number','amount_max', Input::old('amount_max'), ['step' => 'any', 'class' => 'form-control'])}}
</div>
@if($errors->has('amount_max'))
<p class="text-danger">{{$errors->first('amount_max')}}</p>
@endif
</div>
</div>
<div class="form-group">
{{ Form::label('date', 'Date', ['class' => 'col-sm-4 control-label'])}}
<div class="col-sm-8">
{{ Form::input('date','date', Input::old('date') ?: Carbon\Carbon::now()->addDay()->format('Y-m-d'), ['class'
=> 'form-control']) }}
@if($errors->has('date'))
<p class="text-danger">{{$errors->first('date')}}</p>
@endif
</div>
</div>
<div class="form-group">
<label for="period" class="col-sm-4 control-label">Recurrence</label>
<div class="col-sm-8">
{{Form::select('repeat_freq',$periods,Input::old('repeat_freq') ?: 'monthly',['class' => 'form-control'])}}
@if($errors->has('repeat_freq'))
<p class="text-danger">{{$errors->first('repeat_freq')}}</p>
@endif
</div>
</div>
</div>
</div>
<div class="form-group">
{{ Form::label('date', 'Date', ['class' => 'col-sm-4 control-label'])}}
<div class="col-sm-8">
{{ Form::input('date','date', Input::old('date') ?: date('Y-m-d'), ['class'
=> 'form-control']) }}
@if($errors->has('date'))
<p class="text-danger">{{$errors->first('date')}}</p>
@else
<span class="help-block">Select the next date you expect the transaction to occur.</span>
@endif
</div>
</div>
<div class="form-group">
<label for="period" class="col-sm-4 control-label">Recurrence</label>
<div class="col-sm-8">
{{Form::select('repeat_freq',$periods,Input::old('repeat_freq') ?: 'monthly',['class' => 'form-control'])}}
@if($errors->has('repeat_freq'))
<p class="text-danger">{{$errors->first('repeat_freq')}}</p>
@else
<span class="help-block">Select the period over which this transaction repeats</span>
@endif
</div>
</div>
<p>
<button type="submit" class="btn btn-lg btn-success">
<i class="fa fa-plus-circle"></i> Store new recurring transaction
</button>
</p>
</div>
<div class="col-lg-6 col-md-12 col-sm-6">
<h4>Optional fields</h4>
<!-- panel for optional fields -->
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-smile-o"></i> Optional fields
</div>
<div class="panel-body">
<div class="form-group">
{{ Form::label('skip', 'Skip', ['class' => 'col-sm-4 control-label'])}}
<div class="col-sm-8">
{{Form::input('number','skip', Input::old('skip') ?: 0, ['class' => 'form-control'])}}
<div class="form-group">
{{ Form::label('skip', 'Skip', ['class' => 'col-sm-4 control-label'])}}
<div class="col-sm-8">
{{Form::input('number','skip', Input::old('skip') ?: 0, ['class' => 'form-control'])}}
@if($errors->has('skip'))
<p class="text-danger">{{$errors->first('skip')}}</p>
@else
<span class="help-block">Make Firefly skip every <em>n</em> times. Fill in <code>2</code>, and Firefly
will match, skip, skip and match a transaction.</span>
@endif
@if($errors->has('skip'))
<p class="text-danger">{{$errors->first('skip')}}</p>
@else
<span class="help-block">Make Firefly skip every <em>n</em> times. Fill in <code>2</code>, and Firefly
will match, skip, skip and match a transaction.</span>
@endif
</div>
</div>
<div class="form-group">
<label for="automatch" class="col-sm-4 control-label">Auto-match</label>
<div class="col-sm-8">
<div class="checkbox">
<label>
{{Form::checkbox('automatch',1,Input::old('automatch') == '1' || !Input::old('automatch'))}}
Yes
</label>
</div>
<span class="help-block">Firefly will automatically match transactions.</span>
</div>
</div>
<div class="form-group">
<label for="active" class="col-sm-4 control-label">Active</label>
<div class="col-sm-8">
<div class="checkbox">
<label>
{{Form::checkbox('active',1,Input::old('active') == '1' || !Input::old('active'))}}
Yes
</label>
</div>
<span class="help-block">This recurring transaction is actually active.</span>
</div>
</div>
</div>
</div>
<!-- select budget -->
<!-- select category -->
<!-- select beneficiary -->
<div class="form-group">
<label for="automatch" class="col-sm-4 control-label">Auto-match</label>
<div class="col-sm-8">
<div class="checkbox">
<!-- panel for options -->
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-bolt"></i> Options
</div>
<div class="panel-body">
<div class="form-group">
<label for="default" class="col-sm-4 control-label">
Store
</label>
<div class="col-sm-8">
<div class="radio">
<label>
{{Form::radio('post_submit_action','store',true)}}
Store the recurring transaction
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="validate_only" class="col-sm-4 control-label">
Validate only
</label>
<div class="col-sm-8">
<div class="radio">
<label>
{{Form::radio('post_submit_action','validate_only')}}
Only validate, do not save
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="return_to_form" class="col-sm-4 control-label">
Return here
</label>
<div class="col-sm-8">
<div class="radio">
<label>
{{Form::checkbox('automatch',1,Input::old('automatch') == '1' || !Input::old('automatch'))}}
Yes
{{Form::radio('post_submit_action','create_another')}}
After storing, return here to create another one.
</label>
</div>
<span class="help-block">Firefly will automatically match transactions.</span>
</div>
</div>
<div class="form-group">
<label for="active" class="col-sm-4 control-label">Active</label>
<div class="col-sm-8">
<div class="checkbox">
<label>
{{Form::checkbox('active',1,Input::old('active') == '1' || !Input::old('active'))}}
Yes
</label>
</div>
<span class="help-block">This recurring transaction is actually active.</span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-12 col-sm-6">
<!-- add another after this one? -->
<div class="form-group">
<label for="create" class="col-sm-4 control-label">&nbsp;</label>
<div class="col-sm-8">
<div class="checkbox">
<label>
{{Form::checkbox('create',1,Input::old('create') == '1')}}
Create another (return to this form)
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<button type="submit" class="btn btn-default btn-success">Create the recurring transaction</button>
</div>
</div>
</div>
</div>

View File

@@ -1,20 +1,15 @@
@extends('layouts.default')
@section('content')
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<p class="lead">Use recurring transactions to track repeated expenses</p>
<p class="text-info">
Bla bla.
</p>
</div>
</div>
{{Form::open(['class' => 'form-horizontal','url' => route('recurring.update', $recurringTransaction->id)])}}
<div class="row">
<div class="col-lg-6 col-md-12 col-sm-6">
<h4>Mandatory fields</h4>
<!-- panel for mandatory fields -->
<div class="panel panel-primary">
<div class="panel-heading">
<i class="fa fa-exclamation-circle"></i> Mandatory fields
</div>
<div class="panel-body">
<!-- name -->
<div class="form-group">
<label for="name" class="col-sm-4 control-label">Name</label>
@@ -23,8 +18,6 @@
value="{{{Input::old('name') ?: $recurringTransaction->name}}}" placeholder="Name">
@if($errors->has('name'))
<p class="text-danger">{{$errors->first('name')}}</p>
@else
<span class="help-block">For example: rent, gas, insurance</span>
@endif
</div>
</div>
@@ -36,9 +29,6 @@
data-role="tagsinput">
@if($errors->has('match'))
<p class="text-danger">{{$errors->first('match')}}</p>
@else
<span class="help-block">For example: rent, [company name]. All matches need to
be present for the recurring transaction to be recognized. This field is not case-sensitive.</span>
@endif
</div>
</div>
@@ -54,9 +44,6 @@
@if($errors->has('amount_min'))
<p class="text-danger">{{$errors->first('amount_min')}}</p>
@else
<span class="help-block">Firefly will only include transactions with a higher amount than this. If your rent
is usually around &euro; 500,-, enter <code>450</code> to be safe.</span>
@endif
</div>
</div>
@@ -72,9 +59,6 @@
@if($errors->has('amount_max'))
<p class="text-danger">{{$errors->first('amount_max')}}</p>
@else
<span class="help-block">Firefly will only include transactions with a lower amount than this.
If your rent is usually around &euro; 500,-, enter <code>550</code> to be safe.</span>
@endif
</div>
</div>
@@ -86,8 +70,6 @@
['class' => 'form-control']) }}
@if($errors->has('date'))
<p class="text-danger">{{$errors->first('date')}}</p>
@else
<span class="help-block">Select the next date you expect the transaction to occur.</span>
@endif
</div>
</div>
@@ -99,16 +81,26 @@
['class' => 'form-control'])}}
@if($errors->has('repeat_freq'))
<p class="text-danger">{{$errors->first('repeat_freq')}}</p>
@else
<span class="help-block">Select the period over which this transaction repeats</span>
@endif
</div>
</div>
</div>
</div>
<div class="col-lg-6 col-md-12 col-sm-6">
<h4>Optional fields</h4>
<p>
<button type="submit" class="btn btn-lg btn-success">
<i class="fa fa-plus-circle"></i> Update recurring transasction
</button>
</p>
</div>
<div class="col-lg-6 col-md-12 col-sm-6">
<!-- panel for optional fields -->
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-smile-o"></i> Optional fields
</div>
<div class="panel-body">
<div class="form-group">
{{ Form::label('skip', 'Skip', ['class' => 'col-sm-4 control-label'])}}
<div class="col-sm-8">
@@ -117,21 +109,10 @@
@if($errors->has('skip'))
<p class="text-danger">{{$errors->first('skip')}}</p>
@else
<span class="help-block">Make Firefly skip every <em>n</em> times. Fill in <code>2</code>, and Firefly
will match, skip, skip and match a transaction.</span>
@endif
</div>
</div>
<!-- select budget -->
<!-- select category -->
<!-- select beneficiary -->
<div class="form-group">
<label for="automatch" class="col-sm-4 control-label">Auto-match</label>
<div class="col-sm-8">
@@ -159,25 +140,57 @@
<span class="help-block">This recurring transaction is actually active.</span>
</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 recurring transaction</button>
</div>
<!-- panel for options -->
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-bolt"></i> Options
</div>
<div class="panel-body">
<div class="form-group">
<label for="default" class="col-sm-4 control-label">
Update
</label>
<div class="col-sm-8">
<div class="radio">
<label>
{{Form::radio('post_submit_action','store',true)}}
Update the recurring transaction
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="validate_only" class="col-sm-4 control-label">
Validate only
</label>
<div class="col-sm-8">
<div class="radio">
<label>
{{Form::radio('post_submit_action','validate_only')}}
Only validate, do not save changes
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="return_to_form" class="col-sm-4 control-label">
Return here
</label>
<div class="col-sm-8">
<div class="radio">
<label>
{{Form::radio('post_submit_action','return_to_edit')}}
After update, return here again.
</label>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{{Form::close()}}

View File

@@ -1,73 +1,41 @@
@extends('layouts.default')
@section('content')
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<p class="lead">Use recurring transactions to track repeated withdrawals</p>
<p class="text-info">We all have bills to pay. Firefly can help you organize those bills into recurring transactions,
which are exactly what the name suggests. Firefly can match new (and existing) transactions to such a recurring transaction
and help you organize these expenses into manageable groups. The front page of Firefly will show you which recurring
transactions you have missed, which are yet to come and which have been paid.</p>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-sm-12 col-md-12">
<table class="table table-striped">
<tr>
<th>Name</th>
<th>Matches on</th>
<th>Amount between</th>
<th>Expected every</th>
<th>Next expected match</th>
<th>Auto-match</th>
<th>Active</th>
<th></th>
</tr>
@foreach($list as $entry)
<tr>
<td><a href="{{route('recurring.show',$entry->id)}}">{{{$entry->name}}}</a></td>
<td>
@foreach(explode(' ',$entry->match) as $word)
<span class="label label-info">{{{$word}}}</span>
@endforeach
</td>
<td>
{{mf($entry->amount_min)}} &ndash;
{{mf($entry->amount_max)}}
</td>
<td>
{{$entry->repeat_freq}}
</td>
<td>
{{$entry->next()->format('d-m-Y')}}
</td>
<td>
@if($entry->automatch)
<span class="glyphicon glyphicon-ok"></span>
@else
<span class="glyphicon glyphicon-remove"></span>
@endif
</td>
<td>
@if($entry->active)
<span class="glyphicon glyphicon-ok"></span>
@else
<span class="glyphicon glyphicon-remove"></span>
@endif
</td>
<td>
<div class="btn-group btn-group-xs">
<a href="{{route('recurring.edit',$entry->id)}}" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span></a>
<a href="{{route('recurring.delete',$entry->id)}}" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span></a>
</div>
</td>
</tr>
@endforeach
</table>
<p>
<a href="{{route('recurring.create')}}" class="btn btn-success btn-large">Create new recurring transaction</a>
</p>
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa {{$mainTitleIcon}}"></i> {{{$title}}}
</div>
<div class="panel-body">
<table class="table table-striped" id="recurringTable">
<thead>
<tr>
<th>name</th>
<th>match</th>
<th>amount_min</th>
<th>amount_max</th>
<th>date</th>
<th>active</th>
<th>automatch</th>
<th>repeat_freq</th>
<th>id</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
@stop
@section('scripts')
<script type="text/javascript">
var URL = '{{route('json.recurring')}}';
</script>
{{HTML::script('assets/javascript/typeahead/bootstrap3-typeahead.min.js')}}
{{HTML::script('assets/javascript/datatables/jquery.dataTables.min.js')}}
{{HTML::script('assets/javascript/datatables/dataTables.bootstrap.js')}}
{{HTML::script('assets/javascript/firefly/recurring.js')}}
@stop
@section('styles')
{{HTML::style('assets/stylesheets/datatables/dataTables.bootstrap.css')}}
@stop

View File

@@ -12,7 +12,7 @@
<tr>
<th>Date</th>
<th>Description</th>
<th data-dynatable-column="amount">Amount (&euro;)</th>
<th>Amount (&euro;)</th>
<th>From</th>
<th>To</th>
<th>ID</th>