@extends('layouts.app') @section('content')
@if (is_null(request('action'))) @can('update', $transaction) @section('title', __('transaction.edit').' #'.$transaction->id)
{{ __('transaction.edit') }}
{!! Form::model($transaction, ['route' => ['transactions.update', $transaction], 'method' => 'patch', 'autocomplete' => 'off']) !!}
{!! FormField::text('date', ['required' => true, 'label' => __('app.date'), 'class' => 'date-select']) !!}
{!! FormField::select('category_id', $categories, [ 'label' => __('category.category'), 'placeholder' => __('category.uncategorized'), 'info' => ['text' => __('transaction.category_help_text', ['link' => $categorySettingLink])], ]) !!}
{!! FormField::textarea('description', ['required' => true, 'label' => __('transaction.description')]) !!}
{!! FormField::text('amount', [ 'required' => true, 'value' => format_number($transaction->amount), 'label' => __('transaction.amount'), 'addon' => ['before' => config('money.currency_code')], 'step' => number_step(), ]) !!}
{!! FormField::radios('in_out', [__('transaction.spending'), __('transaction.income')], ['required' => true, 'label' => __('transaction.transaction'), 'list_style' => 'unstyled']) !!}
{!! FormField::select('bank_account_id', $bankAccounts, ['label' => __('transaction.origin_destination'), 'placeholder' => __('transaction.cash')]) !!}
@if ($partnerTypeCodes) {!! FormField::select('partner_id', $partners, [ 'label' => $partnerSelectionLabel, 'placeholder' => $partnerDefaultValue, 'info' => ['text' => __('transaction.partner_help_text', ['partner' => $partnerSelectionLabel, 'link' => $partnerSettingLink])], ]) !!} @else {{ Form::hidden('partner_id') }} @endif
{{ Form::close() }}
@endcan @endif @if (request('action') == 'delete') @can('delete', $transaction) @section('title', __('transaction.delete').' #'.$transaction->id)
{{ __('app.delete') }} {{ $transaction->type }}

{{ $transaction->date }}

{{ $transaction->amount_string }}

{!! $transaction->date_alert !!} {!! nl2br(htmlentities($transaction->description)) !!}

{{ optional($transaction->category)->name }}

{{ optional($transaction->partner)->name }}

{{ $transaction->bankAccount->name }}

{!! $errors->first('transaction_id', ':message') !!}

{{ __('app.delete_confirm') }}
@endcan @endif
@endsection @section('styles') {{ Html::style(url('css/plugins/jquery.datetimepicker.css')) }} {{ Html::style(url('css/plugins/select2.min.css')) }} {{ Html::style(url('css/plugins/select2-bootstrap.min.css')) }} @endsection @push('scripts') {{ Html::script(url('js/plugins/jquery.datetimepicker.js')) }} {{ Html::script(url('js/plugins/select2.min.js')) }} {{ Html::script(url('js/plugins/number-format.js')) }} @endpush