{!! Form::open(['url' => action([\App\Http\Controllers\AccountController::class, 'updateAccountTransaction'], ['id' => $account_transaction->id ]), 'method' => 'post', 'id' => 'edit_account_transaction_form' ]) !!}
@lang('account.selected_account'):
{{$account_transaction->account->name}}
@if($account_transaction->sub_type == 'deposit')
@php
$label = !empty($account_transaction->type == 'debit') ? __( 'account.deposit_from' ) : __('lang_v1.deposit_to');
@endphp
{!! Form::label('account_id', $label .":") !!}
{!! Form::select('account_id', $accounts, $account_transaction->account_id, ['class' => 'form-control', 'placeholder' => __('messages.please_select') ]); !!}
@endif
@if($account_transaction->sub_type == 'fund_transfer')
@php
$label = !empty($account_transaction->type == 'credit') ? __( 'account.transfer_to' ) :__('lang_v1.transfer_from') ;
@endphp
{!! Form::label('account_id', $label .":") !!}
{!! Form::select('account_id', $accounts, $account_transaction->account_id, ['class' => 'form-control', 'placeholder' => __('messages.please_select') ]); !!}
@endif
{!! Form::label('amount', __( 'sale.amount' ) .":*") !!}
{!! Form::text('amount', @num_format($account_transaction->amount), ['class' => 'form-control input_number', 'required','placeholder' => __( 'sale.amount' ) ]); !!}
@if($account_transaction->sub_type == 'deposit')
@php
$label = !empty($account_transaction->type == 'debit') ? __('lang_v1.deposit_to') : __( 'account.deposit_from' );
@endphp
{!! Form::label('from_account', $label .":") !!}
{!! Form::select('from_account', $accounts, $account_transaction->transfer_transaction->account_id ?? null, ['class' => 'form-control', 'placeholder' => __('messages.please_select') ]); !!}
@endif
@if($account_transaction->sub_type == 'fund_transfer')
@php
$label = !empty($account_transaction->type == 'credit') ? __('lang_v1.transfer_from') : __( 'account.transfer_to' );
@endphp
{!! Form::label('to_account', $label .":*") !!}
{!! Form::select('to_account', $accounts, $account_transaction->transfer_transaction->account_id ?? null, ['class' => 'form-control', 'required' ]); !!}
@endif
@if($account_transaction->sub_type == 'fund_transfer' || $account_transaction->sub_type == 'deposit')
{!! Form::label('note', __( 'brand.note' )) !!}
{!! Form::textarea('note', $account_transaction->note, ['class' => 'form-control', 'placeholder' => __( 'brand.note' ), 'rows' => 4]); !!}
@endif