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

Firefly Add a new {{$what}}

Technically speaking, withdrawals, deposits and transfers are all transactions, moving money from account A to account B.

@if($what == 'withdrawal') A withdrawal is when you spend money on something, moving an amount to a beneficiary. @endif @if($what == 'deposit') A deposit is when you earn money, moving an amount from a beneficiary into your own account. @endif @if($what == 'transfer') TRANSFER @endif

{{Form::open(['class' => 'form-horizontal','url' => route('transactions.store',$what)])}} {{Form::hidden('reminder',Input::get('reminder_id'))}}

Mandatory fields

@if($errors->has('description'))

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

@endif
@if($what == 'deposit' || $what == 'withdrawal')
{{Form::select('account_id',$accounts,Input::old('account_id') ?: Input::get('account_id'),['class' => 'form-control'])}} @if($errors->has('account_id'))

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

@endif
@endif @if($what == 'deposit' || $what == 'withdrawal')
@if($errors->has('beneficiary'))

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

@else This field will auto-complete your existing beneficiaries (if any), but you can type freely to create new ones. @endif
@endif @if($what == 'transfer')
{{Form::select('account_from_id',$accounts,Input::old('account_from_id') ?: Input::get('account_from_id'),['class' => 'form-control'])}} @if($errors->has('account_from_id'))

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

@endif
{{Form::select('account_to_id',$accounts,Input::old('account_to_id') ?: Input::get('account_to_id'),['class' => 'form-control'])}} @if($errors->has('account_to_id'))

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

@endif
@endif
@if($errors->has('amount'))

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

@endif
@if($errors->has('date'))

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

@endif

Optional fields

@if($what == 'withdrawal')
{{Form::select('budget_id',$budgets,Input::old('budget_id') ?: 0,['class' => 'form-control'])}} @if($errors->has('budget_id'))

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

@else Select one of your budgets to make this transaction a part of it. @endif
@endif
@if($errors->has('category'))

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

@else Add more fine-grained information to this transaction by entering a category. Like the beneficiary-field, this field will auto-complete existing categories but can also be used to create new ones. @endif
@if($what == 'transfer' && count($piggies) > 0)
@if($errors->has('piggybank_id'))

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

@else You can directly add the amount you're transferring to one of your piggy banks, provided they are related to the account your transferring to. @endif
@endif
{{Form::close()}} @stop @section('scripts') @stop