Extended forms and started on recurring transactions.

This commit is contained in:
Sander Dorigo 2014-10-05 19:29:25 +02:00
parent 980d9ce885
commit 28aaea1aa3
10 changed files with 193 additions and 201 deletions

View File

@ -37,8 +37,8 @@ return [
'Illuminate\Validation\ValidationServiceProvider', 'Illuminate\Validation\ValidationServiceProvider',
'Illuminate\View\ViewServiceProvider', 'Illuminate\View\ViewServiceProvider',
'Illuminate\Workbench\WorkbenchServiceProvider', 'Illuminate\Workbench\WorkbenchServiceProvider',
'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider', # 'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider',
'Barryvdh\Debugbar\ServiceProvider', # 'Barryvdh\Debugbar\ServiceProvider',
'Firefly\Storage\StorageServiceProvider', 'Firefly\Storage\StorageServiceProvider',
'Firefly\Helper\HelperServiceProvider', 'Firefly\Helper\HelperServiceProvider',
'Firefly\Validation\ValidationServiceProvider', 'Firefly\Validation\ValidationServiceProvider',

View File

@ -19,8 +19,8 @@ class RecurringController extends BaseController
{ {
$this->_repository = $repository; $this->_repository = $repository;
View::share('title','Recurring transactions'); View::share('title', 'Recurring transactions');
View::share('mainTitleIcon','fa-rotate-right'); View::share('mainTitleIcon', 'fa-rotate-right');
} }
/** /**
@ -28,7 +28,7 @@ class RecurringController extends BaseController
*/ */
public function create() public function create()
{ {
View::share('subTitle','Create new'); View::share('subTitle', 'Create new');
$periods = \Config::get('firefly.periods_to_text'); $periods = \Config::get('firefly.periods_to_text');
return View::make('recurring.create')->with('periods', $periods); return View::make('recurring.create')->with('periods', $periods);
@ -41,7 +41,7 @@ class RecurringController extends BaseController
*/ */
public function delete(RecurringTransaction $recurringTransaction) public function delete(RecurringTransaction $recurringTransaction)
{ {
View::share('subTitle','Delete "' .$recurringTransaction->name.'"'); View::share('subTitle', 'Delete "' . $recurringTransaction->name . '"');
return View::make('recurring.delete')->with('recurringTransaction', $recurringTransaction); return View::make('recurring.delete')->with('recurringTransaction', $recurringTransaction);
} }
@ -73,7 +73,7 @@ class RecurringController extends BaseController
{ {
$periods = \Config::get('firefly.periods_to_text'); $periods = \Config::get('firefly.periods_to_text');
View::share('subTitle','Edit "' .$recurringTransaction->name.'"'); View::share('subTitle', 'Edit "' . $recurringTransaction->name . '"');
return View::make('recurring.edit')->with('periods', $periods)->with( return View::make('recurring.edit')->with('periods', $periods)->with(
'recurringTransaction', $recurringTransaction 'recurringTransaction', $recurringTransaction
@ -93,14 +93,11 @@ class RecurringController extends BaseController
*/ */
public function show(RecurringTransaction $recurringTransaction) public function show(RecurringTransaction $recurringTransaction)
{ {
View::share('subTitle',$recurringTransaction->name); View::share('subTitle', $recurringTransaction->name);
return View::make('recurring.show')->with('recurring', $recurringTransaction); return View::make('recurring.show')->with('recurring', $recurringTransaction);
} }
/**
* @return $this|\Illuminate\Http\RedirectResponse
*/
public function store() public function store()
{ {
@ -108,25 +105,54 @@ class RecurringController extends BaseController
default: default:
throw new FireflyException('Method ' . Input::get('post_submit_action') . ' not implemented yet.'); throw new FireflyException('Method ' . Input::get('post_submit_action') . ' not implemented yet.');
break; break;
case 'store':
case 'create_another':
/*
* Try to store:
*/
$messageBag = $this->_repository->store(Input::all());
/*
* Failure!
*/
if ($messageBag->count() > 0) {
Session::flash('error', 'Could not save recurring transaction: ' . $messageBag->first());
return Redirect::route('recurring.create')->withInput()->withErrors($messageBag);
}
/*
* Success!
*/
Session::flash('success', 'Recurring transaction "' . e(Input::get('name')) . '" saved!');
/*
* Redirect to original location or back to the form.
*/
if (Input::get('post_submit_action') == 'create_another') {
return Redirect::route('recurring.create')->withInput();
} else {
return Redirect::route('recurring.index');
}
break;
} }
$recurringTransaction = $this->_repository->store(Input::all()); //
//
if ($recurringTransaction->errors()->count() == 0) { // if ($recurringTransaction->errors()->count() == 0) {
Session::flash('success', 'Recurring transaction "' . $recurringTransaction->name . '" saved!'); // Session::flash('success', 'Recurring transaction "' . $recurringTransaction->name . '" saved!');
//Event::fire('recurring.store', [$recurringTransaction]); // //Event::fire('recurring.store', [$recurringTransaction]);
if (Input::get('create') == '1') { // if (Input::get('create') == '1') {
return Redirect::route('recurring.create')->withInput(); // return Redirect::route('recurring.create')->withInput();
} else { // } else {
return Redirect::route('recurring.index'); // return Redirect::route('recurring.index');
} // }
} else { // } else {
Session::flash( // Session::flash(
'error', 'Could not save the recurring transaction: ' . $recurringTransaction->errors()->first() // 'error', 'Could not save the recurring transaction: ' . $recurringTransaction->errors()->first()
); // );
//
return Redirect::route('recurring.create')->withInput()->withErrors($recurringTransaction->errors()); // return Redirect::route('recurring.create')->withInput()->withErrors($recurringTransaction->errors());
} // }
} }
/** /**

View File

@ -67,19 +67,9 @@ class TransactionController extends BaseController
$piggies = $toolkit->makeSelectList($piggyRepository->get()); $piggies = $toolkit->makeSelectList($piggyRepository->get());
$piggies[0] = '(no piggy bank)'; $piggies[0] = '(no piggy bank)';
/*
* Catch messages from validation round:
*/
if (Session::has('messages')) {
$messages = Session::get('messages');
Session::forget('messages');
} else {
$messages = new MessageBag;
}
return View::make('transactions.create')->with('accounts', $assetAccounts)->with('budgets', $budgets)->with( return View::make('transactions.create')->with('accounts', $assetAccounts)->with('budgets', $budgets)->with(
'what', $what 'what', $what
)->with('piggies', $piggies)->with('subTitle', 'Add a new ' . $what)->with('messages', $messages); )->with('piggies', $piggies)->with('subTitle', 'Add a new ' . $what);
} }
/** /**

View File

@ -16,19 +16,52 @@ class Form
* @return string * @return string
* @throws FireflyException * @throws FireflyException
*/ */
public static function ffNumber($name, $value = null, array $options = []) public static function ffInteger($name, $value = null, array $options = [])
{ {
$options['step'] = 'any'; $options['step'] = '1';
$options['min'] = '0.01';
return self::ffInput('number', $name, $value, $options); return self::ffInput('number', $name, $value, $options);
} }
public static function ffCheckbox($name, $value = 1, $checked = null, $options = [])
{
$options['checked'] = $checked ? true : null;
return self::ffInput('checkbox', $name, $value, $options);
}
public static function ffAmount($name, $value = null, array $options = [])
{
$options['step'] = 'any';
$options['min'] = '0.01';
return self::ffInput('amount', $name, $value, $options);
}
/**
* @param $name
* @param null $value
* @param array $options
* @return string
* @throws FireflyException
*/
public static function ffDate($name, $value = null, array $options = []) public static function ffDate($name, $value = null, array $options = [])
{ {
return self::ffInput('date', $name, $value, $options); return self::ffInput('date', $name, $value, $options);
} }
/**
* @param $name
* @param null $value
* @param array $options
* @return string
* @throws FireflyException
*/
public static function ffTags($name, $value = null, array $options = [])
{
$options['data-role'] = 'tagsinput';
return self::ffInput('text', $name, $value, $options);
}
/** /**
* @param $name * @param $name
* @param array $list * @param array $list
@ -55,6 +88,22 @@ class Form
} }
public static function label($name)
{
$labels = [
'amount_min' => 'Amount (min)',
'amount_max' => 'Amount (max)',
'match' => 'Matches on',
'repeat_freq' => 'Repetition',
'account_from_id' => 'Account from',
'account_to_id' => 'Account to',
'account_id' => 'Asset account'
];
return isset($labels[$name]) ? $labels[$name] : str_replace('_',' ',ucfirst($name));
}
/** /**
* @param $type * @param $type
* @param $name * @param $name
@ -72,18 +121,11 @@ class Form
$options['class'] = 'form-control'; $options['class'] = 'form-control';
$options['id'] = 'ffInput_' . $name; $options['id'] = 'ffInput_' . $name;
$options['autocomplete'] = 'off'; $options['autocomplete'] = 'off';
$options['type'] = 'text'; $label = self::label($name);
/* /*
* Make label and placeholder look nice. * Make label and placeholder look nice.
*/ */
$options['placeholder'] = isset($options['label']) ? $options['label'] : ucfirst($name); $options['placeholder'] = ucfirst($name);
$options['label'] = isset($options['label']) ? $options['label'] : ucfirst($name);
if ($name == 'account_id') {
$options['label'] = 'Asset account';
}
$options['label'] = str_replace(['_'], [' '], $options['label']);
$options['placeholder'] = str_replace(['_'], [' '], $options['placeholder']);
/* /*
* Get the value. * Get the value.
@ -129,7 +171,6 @@ class Form
/* /*
* Add some HTML. * Add some HTML.
*/ */
$label = isset($options['label']) ? $options['label'] : ucfirst($name);
$html = '<div class="' . $classes . '">'; $html = '<div class="' . $classes . '">';
$html .= '<label for="' . $options['id'] . '" class="col-sm-4 control-label">' . $label . '</label>'; $html .= '<label for="' . $options['id'] . '" class="col-sm-4 control-label">' . $label . '</label>';
$html .= '<div class="col-sm-8">'; $html .= '<div class="col-sm-8">';
@ -138,14 +179,27 @@ class Form
/* /*
* Switch input type: * Switch input type:
*/ */
unset($options['label']);
switch ($type) { switch ($type) {
case 'text': case 'text':
$html .= \Form::input('text', $name, $value, $options); $html .= \Form::input('text', $name, $value, $options);
break; break;
case 'number': case 'amount':
$html .= '<div class="input-group"><div class="input-group-addon">&euro;</div>'; $html .= '<div class="input-group"><div class="input-group-addon">&euro;</div>';
$html .= \Form::input('number', $name, $value, $options); $html .= \Form::input('number', $name, $value, $options);
$html .= '</div>'; $html .= '</div>';
break;
case 'number':
$html .= \Form::input('number', $name, $value, $options);
break;
case 'checkbox':
$checked = $options['checked'];
unset($options['checked'], $options['placeholder'], $options['autocomplete'], $options['class']);
$html .= '<div class="checkbox"><label>';
$html .= \Form::checkbox($name, $value, $checked, $options);
$html .= '</label></div>';
break; break;
case 'date': case 'date':
$html .= \Form::input('date', $name, $value, $options); $html .= \Form::input('date', $name, $value, $options);

View File

@ -5,6 +5,7 @@ namespace Firefly\Storage\RecurringTransaction;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Queue\Jobs\Job; use Illuminate\Queue\Jobs\Job;
use Illuminate\Support\MessageBag;
/** /**
* Class EloquentRecurringTransactionRepository * Class EloquentRecurringTransactionRepository
@ -45,7 +46,7 @@ class EloquentRecurringTransactionRepository implements RecurringTransactionRepo
} }
/** /**
* @param Job $job * @param Job $job
* @param array $payload * @param array $payload
* *
* @return mixed * @return mixed
@ -57,13 +58,13 @@ class EloquentRecurringTransactionRepository implements RecurringTransactionRepo
/** @var \Importmap $importMap */ /** @var \Importmap $importMap */
$importMap = $repository->findImportmap($payload['mapID']); $importMap = $repository->findImportmap($payload['mapID']);
$user = $importMap->user; $user = $importMap->user;
$this->overruleUser($user); $this->overruleUser($user);
/* /*
* maybe the recurring transaction is already imported: * maybe the recurring transaction is already imported:
*/ */
$oldId = intval($payload['data']['id']); $oldId = intval($payload['data']['id']);
$description = $payload['data']['description']; $description = $payload['data']['description'];
$importEntry = $repository->findImportEntry($importMap, 'RecurringTransaction', $oldId); $importEntry = $repository->findImportEntry($importMap, 'RecurringTransaction', $oldId);
@ -84,17 +85,17 @@ class EloquentRecurringTransactionRepository implements RecurringTransactionRepo
$recurringTransaction = $this->findByName($payload['data']['description']); $recurringTransaction = $this->findByName($payload['data']['description']);
if (is_null($recurringTransaction)) { if (is_null($recurringTransaction)) {
$amount = floatval($payload['data']['amount']); $amount = floatval($payload['data']['amount']);
$pct = intval($payload['data']['pct']); $pct = intval($payload['data']['pct']);
$set = [ $set = [
'name' => $description, 'name' => $description,
'match' => join(',', explode(' ', $description)), 'match' => join(',', explode(' ', $description)),
'amount_min' => $amount * ($pct / 100) * -1, 'amount_min' => $amount * ($pct / 100) * -1,
'amount_max' => $amount * (1 + ($pct / 100)) * -1, 'amount_max' => $amount * (1 + ($pct / 100)) * -1,
'date' => date('Y-m-') . $payload['data']['dom'], 'date' => date('Y-m-') . $payload['data']['dom'],
'repeat_freq' => 'monthly', 'repeat_freq' => 'monthly',
'active' => intval($payload['data']['inactive']) == 1 ? 0 : 1, 'active' => intval($payload['data']['inactive']) == 1 ? 0 : 1,
'automatch' => 1, 'automatch' => 1,
]; ];
$recurringTransaction = $this->store($set); $recurringTransaction = $this->store($set);
@ -131,45 +132,52 @@ class EloquentRecurringTransactionRepository implements RecurringTransactionRepo
/** /**
* @param $data * @param $data
* *
* @return mixed|\RecurringTransaction * @return MessageBag
*/ */
public function store($data) public function store($data)
{ {
$messageBag = new MessageBag;
$recurringTransaction = new \RecurringTransaction( $recurringTransaction = new \RecurringTransaction(
[ [
'user_id' => $this->_user->id, 'user_id' => $this->_user->id,
'name' => $data['name'], 'name' => $data['name'],
'match' => join(' ', explode(',', $data['match'])), 'match' => join(' ', explode(',', $data['match'])),
'amount_max' => floatval($data['amount_max']), 'amount_max' => floatval($data['amount_max']),
'amount_min' => floatval($data['amount_min']), 'amount_min' => floatval($data['amount_min']),
'date' => new Carbon($data['date']), 'date' => new Carbon($data['date']),
'active' => isset($data['active']) ? intval($data['active']) : 0, 'active' => isset($data['active']) ? intval($data['active']) : 0,
'automatch' => isset($data['automatch']) ? intval($data['automatch']) : 0, 'automatch' => isset($data['automatch']) ? intval($data['automatch']) : 0,
'skip' => isset($data['skip']) ? intval($data['skip']) : 0, 'skip' => isset($data['skip']) ? intval($data['skip']) : 0,
'repeat_freq' => $data['repeat_freq'], 'repeat_freq' => $data['repeat_freq'],
] ]
); );
// unique name?
$count = $this->_user->recurringtransactions()->whereName($data['name'])->count();
if($count > 0) {
$messageBag->add('name', 'A recurring transaction with this name already exists.');
return $messageBag;
}
// both amounts zero?: // both amounts zero?:
if ($recurringTransaction->amount_max == 0 && $recurringTransaction->amount_min == 0) { if ($recurringTransaction->amount_max == 0 && $recurringTransaction->amount_min == 0) {
$recurringTransaction->errors()->add('amount_max', 'Amount max and min cannot both be zero.'); $messageBag->add('amount_max', 'Amount max and min cannot both be zero.');
return $messageBag;
return $recurringTransaction;
} }
if ($recurringTransaction->amount_max < $recurringTransaction->amount_min) { if ($recurringTransaction->amount_max < $recurringTransaction->amount_min) {
$recurringTransaction->errors()->add('amount_max', 'Amount max must be more than amount min.'); $messageBag->add('amount_max', 'Amount max must be more than amount min.');
return $recurringTransaction; return $messageBag;
} }
if ($recurringTransaction->amount_min > $recurringTransaction->amount_max) { if ($recurringTransaction->amount_min > $recurringTransaction->amount_max) {
$recurringTransaction->errors()->add('amount_max', 'Amount min must be less than amount max.'); $messageBag->add('amount_max', 'Amount min must be less than amount max.');
return $recurringTransaction; return $messageBag;
} }
if($recurringTransaction->date < Carbon::now()) { if ($recurringTransaction->date < Carbon::now()) {
$recurringTransaction->errors()->add('date', 'Must be in the future.'); $messageBag->add('date', 'Must be in the future.');
return $recurringTransaction; return $messageBag;
} }
@ -177,7 +185,7 @@ class EloquentRecurringTransactionRepository implements RecurringTransactionRepo
$recurringTransaction->save(); $recurringTransaction->save();
} }
return $recurringTransaction; return $messageBag;
} }
/** /**
@ -188,8 +196,8 @@ class EloquentRecurringTransactionRepository implements RecurringTransactionRepo
*/ */
public function update(\RecurringTransaction $recurringTransaction, $data) public function update(\RecurringTransaction $recurringTransaction, $data)
{ {
$recurringTransaction->name = $data['name']; $recurringTransaction->name = $data['name'];
$recurringTransaction->match = join(' ', explode(',', $data['match'])); $recurringTransaction->match = join(' ', explode(',', $data['match']));
$recurringTransaction->amount_max = floatval($data['amount_max']); $recurringTransaction->amount_max = floatval($data['amount_max']);
$recurringTransaction->amount_min = floatval($data['amount_min']); $recurringTransaction->amount_min = floatval($data['amount_min']);
@ -199,10 +207,10 @@ class EloquentRecurringTransactionRepository implements RecurringTransactionRepo
return $recurringTransaction; return $recurringTransaction;
} }
$recurringTransaction->date = new Carbon($data['date']); $recurringTransaction->date = new Carbon($data['date']);
$recurringTransaction->active = isset($data['active']) ? intval($data['active']) : 0; $recurringTransaction->active = isset($data['active']) ? intval($data['active']) : 0;
$recurringTransaction->automatch = isset($data['automatch']) ? intval($data['automatch']) : 0; $recurringTransaction->automatch = isset($data['automatch']) ? intval($data['automatch']) : 0;
$recurringTransaction->skip = isset($data['skip']) ? intval($data['skip']) : 0; $recurringTransaction->skip = isset($data['skip']) ? intval($data['skip']) : 0;
$recurringTransaction->repeat_freq = $data['repeat_freq']; $recurringTransaction->repeat_freq = $data['repeat_freq'];
if ($recurringTransaction->validate()) { if ($recurringTransaction->validate()) {

View File

@ -3,6 +3,7 @@
namespace Firefly\Storage\RecurringTransaction; namespace Firefly\Storage\RecurringTransaction;
use Illuminate\Queue\Jobs\Job; use Illuminate\Queue\Jobs\Job;
use Illuminate\Support\MessageBag;
/** /**
* Interface RecurringTransactionRepositoryInterface * Interface RecurringTransactionRepositoryInterface
@ -34,7 +35,7 @@ interface RecurringTransactionRepositoryInterface
/** /**
* @param $data * @param $data
* *
* @return mixed * @return MessageBag
*/ */
public function store($data); public function store($data);

View File

@ -78,12 +78,21 @@ App::down(
\Form::macro('ffSelect', function ($name, array $list = [], $selected = null, array $options = []) { \Form::macro('ffSelect', function ($name, array $list = [], $selected = null, array $options = []) {
return \Firefly\Form\Form::ffSelect($name, $list, $selected, $options); return \Firefly\Form\Form::ffSelect($name, $list, $selected, $options);
}); });
\Form::macro('ffNumber', function ($name, $value = null, array $options = []) { \Form::macro('ffInteger', function ($name, $value = null, array $options = []) {
return \Firefly\Form\Form::ffNumber($name, $value, $options); return \Firefly\Form\Form::ffInteger($name, $value, $options);
});
\Form::macro('ffAmount', function ($name, $value = null, array $options = []) {
return \Firefly\Form\Form::ffAmount($name, $value, $options);
}); });
\Form::macro('ffDate', function ($name, $value = null, array $options = []) { \Form::macro('ffDate', function ($name, $value = null, array $options = []) {
return \Firefly\Form\Form::ffDate($name, $value, $options); return \Firefly\Form\Form::ffDate($name, $value, $options);
}); });
\Form::macro('ffTags', function ($name, $value = null, array $options = []) {
return \Firefly\Form\Form::ffTags($name, $value, $options);
});
\Form::macro('ffCheckbox',function ($name, $value = 1, $checked = null, $options = []) {
return \Firefly\Form\Form::ffCheckbox($name, $value, $checked, $options);
});
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View File

@ -10,74 +10,12 @@
<i class="fa fa-exclamation-circle"></i> Mandatory fields <i class="fa fa-exclamation-circle"></i> Mandatory fields
</div> </div>
<div class="panel-body"> <div class="panel-body">
<!-- name --> {{Form::ffText('name')}}
<div class="form-group"> {{Form::ffTags('match')}}
<label for="name" class="col-sm-4 control-label">Name</label> {{Form::ffAmount('amount_min')}}
<div class="col-sm-8"> {{Form::ffAmount('amount_max')}}
<input type="text" name="name" class="form-control" id="name" value="{{Input::old('name')}}" placeholder="Name"> {{Form::ffDate('date',Carbon\Carbon::now()->addDay()->format('Y-m-d'))}}
@if($errors->has('name')) {{Form::ffSelect('repeat_freq',$periods,'monthly')}}
<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>
<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>
@if($errors->has('amount_min'))
<p class="text-danger">{{$errors->first('amount_min')}}</p>
@endif
</div>
</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'])}}
</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> </div>
<p> <p>
@ -93,43 +31,9 @@
<i class="fa fa-smile-o"></i> Optional fields <i class="fa fa-smile-o"></i> Optional fields
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="form-group"> {{Form::ffInteger('skip',0)}}
{{ Form::label('skip', 'Skip', ['class' => 'col-sm-4 control-label'])}} {{Form::ffCheckbox('automatch',1,true)}}
<div class="col-sm-8"> {{Form::ffCheckbox('active',1,true)}}
{{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
</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>
</div> </div>

View File

@ -37,7 +37,7 @@
<!-- ALWAYS SHOW AMOUNT --> <!-- ALWAYS SHOW AMOUNT -->
{{Form::ffNumber('amount')}} {{Form::ffAmount('amount')}}
<!-- ALWAYS SHOW DATE --> <!-- ALWAYS SHOW DATE -->
{{Form::ffDate('date', date('Y-m-d'))}} {{Form::ffDate('date', date('Y-m-d'))}}

View File

@ -35,7 +35,7 @@
@endif @endif
<!-- ALWAYS SHOW AMOUNT --> <!-- ALWAYS SHOW AMOUNT -->
{{Form::ffNumber('amount',$data['amount'])}} {{Form::ffAmount('amount',$data['amount'])}}
<!-- ALWAYS SHOW DATE --> <!-- ALWAYS SHOW DATE -->
{{Form::ffDate('date',$data['date'])}} {{Form::ffDate('date',$data['date'])}}