@extends('layouts.default') @section('content')

Firefly uses an "envelope system" for your 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.

This form allows you to edit the envelope for budget {{{$limit->budget->name}}}, with a content of {{mf($limit->amount,false)}} @if($limit->repeats == 0) in {{$limit->limitrepetitions[0]->startdate->format('M Y')}} ({{$limit->repeat_freq}}). @endif

{{Form::open(['class' => 'form-horizontal','url' => route('budgets.limits.update',$limit->id)])}} {{Form::hidden('from',e(Input::get('from')))}}

Mandatory fields

{{ Form::label('budget_id', 'Budget', ['class' => 'col-sm-4 control-label'])}}
{{Form::select('budget_id',$budgets,Input::old('budget_id') ?: $limit->component_id, ['class' => 'form-control'])}} @if($errors->has('budget_id'))

{{$errors->first('name')}}

@else Select one of your existing budgets. @endif
{{ Form::label('startdate', 'Start date', ['class' => 'col-sm-4 control-label'])}}
This date indicates when the envelope "starts". The date you select here will correct itself to the nearest [period] you select below.
{{Form::select('period',$periods,Input::old('period') ?: $limit->repeat_freq,['class' => 'form-control'])}} How long will the envelope last? A week, a month, or even longer?
If you want, Firefly can automatically recreate the "envelope" and fill it again when the timespan above has expired. Be careful with this option though. It makes it easier to fall back to old habits. Instead, you should recreate the envelope yourself each [period].
{{ Form::label('amount', 'Amount', ['class' => 'col-sm-4 control-label'])}}
Of course, there needs to be money in the envelope.
{{ Form::label('submit', ' ', ['class' => 'col-sm-4 control-label'])}}
@if($limit->repeats == 1)

Auto repeating

This envelope is set to repeat itself; creating a new period whenever the previous period has passed. If you change this envelope, you'll also change the following (automatically created) envelopes. {{$limit->limitrepetitions()->count() }}

@endif
{{Form::close()}} @stop