{!! Form::open(['route' => 'admin.support.refund.initiate', 'files' => true, 'id' => 'form', 'data-toggle' => 'validator']) !!}
{{ trans('app.form.form') }}
@if (isset($order)) {!! Form::hidden('order_id', $order->id) !!} {!! Form::label('', trans('app.form.order_number') . '*', ['class' => 'with-help']) !!} {!! Form::text('', $order->order_number, ['class' => 'form-control', 'disabled']) !!} @else {!! Form::label('order_id', trans('app.form.select_refund_order') . '*', ['class' => 'with-help']) !!} {!! Form::select('order_id', $orders, null, ['class' => 'form-control select2-normal', 'placeholder' => trans('app.placeholder.select'), 'required']) !!}
@endif
{!! Form::label('status', trans('app.form.status') . '*', ['class' => 'with-help']) !!} {!! Form::select('status', $statuses, isset($order) && $order->dispute ? \App\Models\Refund::STATUS_APPROVED : \App\Models\Refund::STATUS_NEW, ['class' => 'form-control select2-normal', 'placeholder' => trans('app.placeholder.status'), 'required']) !!}
@if (is_int($order) && $order->refunds->count())
{{ trans('app.previous_refunds') }} @foreach ($order->refunds as $refund) @endforeach
{{ $refund->created_at->diffForHumans() }} {{ get_formated_currency($refund->amount) }} {!! $refund->statusName() !!}
@endif
{!! Form::label('amount', trans('app.form.refund_amount') . '*') !!}
@if (get_currency_prefix()) {{ get_currency_prefix() }} @endif {!! Form::number('amount', isset($order) && $order->dispute && $order->dispute->refund_amount ? get_formated_decimal($order->dispute->refund_amount, true, config('system_settings.decimals', 2)) : null, ['class' => 'form-control', 'step' => 'any', 'placeholder' => trans('app.placeholder.refund_amount'), 'required']) !!} @if (get_currency_suffix()) {{ get_currency_suffix() }} @endif
@if (isset($order)) @php $refunded_amt = $order->refundedSum(); @endphp @if ($refunded_amt > 0)

{{ trans('app.alert') }}!

{!! trans('help.order_refunded', ['amount' => get_formated_currency($refunded_amt), 'total' => get_formated_currency($order->grand_total, 2, config('system_settings.currency.id'))]) !!}
@else {!! trans('help.customer_paid', ['amount' => get_formated_currency($order->grand_total, 2, config('system_settings.currency.id'))]) !!} @endif @endif
{{ Form::hidden('return_goods', 0) }} {!! Form::checkbox('return_goods', null, null, ['class' => 'icheckbox_line']) !!} {!! Form::label('return_goods', trans('app.form.return_goods')) !!}
{{ Form::hidden('order_fulfilled', 0) }} @if (isset($order)) {!! Form::checkbox('order_fulfilled', null, $order->isFulfilled() ? 1 : null, ['class' => 'icheckbox_line']) !!} @else {!! Form::checkbox('order_fulfilled', null, null, ['class' => 'icheckbox_line']) !!} @endif {!! Form::label('order_fulfilled', trans('app.form.order_fulfilled')) !!}
{!! Form::label('description', trans('app.form.description')) !!} {!! Form::textarea('description', null, ['class' => 'form-control summernote-without-toolbar', 'placeholder' => trans('app.placeholder.description')]) !!}
{!! Form::checkbox('notify_customer', 1, null, ['class' => 'icheck', 'id' => 'notify_customer', 'checked']) !!} {!! Form::label('notify_customer', strtoupper(trans('app.notify_customer')), ['class' => 'indent5']) !!}

* {{ trans('app.form.required_fields') }}

{!! Form::submit(trans('app.form.initiate'), ['class' => 'btn btn-flat btn-new']) !!}
{!! Form::close() !!}