@php $isNew = ! $claim; @endphp
<div class="modal-dialog" role="document"><div class="modal-content">
    {!! Form::open(['route' => $isNew ? ['vrc.insurance-claims.store', $ro->id] : ['vrc.insurance-claims.update', $claim->id], 'method' => $isNew ? 'POST' : 'PUT', 'class' => 'vrc-form']) !!}
    <div class="modal-header"><button type="button" class="close" data-dismiss="modal">&times;</button><h4 class="modal-title">@lang('vrc::lang.insurance_claim')</h4></div>
    <div class="modal-body">
        <div class="form-group">{!! Form::label('insurance_company_id', __('vrc::lang.insurance_company').':*') !!}{!! Form::select('insurance_company_id', $companies, optional($claim)->insurance_company_id, ['class'=>'form-control','required','placeholder'=>__('messages.please_select')]) !!}</div>
        <div class="row">
            <div class="col-md-6"><div class="form-group">{!! Form::label('policy_no', __('vrc::lang.policy_no').':') !!}{!! Form::text('policy_no', optional($claim)->policy_no, ['class'=>'form-control']) !!}</div></div>
            <div class="col-md-6"><div class="form-group">{!! Form::label('claim_no', __('vrc::lang.claim_no').':') !!}{!! Form::text('claim_no', optional($claim)->claim_no, ['class'=>'form-control']) !!}</div></div>
        </div>
        <div class="form-group">{!! Form::label('status', __('vrc::lang.status').':*') !!}
            {!! Form::select('status', ['draft'=>__('vrc::lang.claim_draft'),'submitted'=>__('vrc::lang.claim_submitted'),'approved'=>__('vrc::lang.claim_approved'),'partially_approved'=>__('vrc::lang.claim_partially_approved'),'rejected'=>__('vrc::lang.claim_rejected'),'settled'=>__('vrc::lang.claim_settled')], optional($claim)->status ?? 'draft', ['class'=>'form-control']) !!}</div>
        <div class="row">
            <div class="col-md-6"><div class="form-group">{!! Form::label('approved_amount', __('vrc::lang.approved_amount').':') !!}{!! Form::number('approved_amount', optional($claim)->approved_amount, ['class'=>'form-control','step'=>'0.01','min'=>0]) !!}</div></div>
            <div class="col-md-6"><div class="form-group">{!! Form::label('excess_amount', __('vrc::lang.excess_amount').':') !!}{!! Form::number('excess_amount', optional($claim)->excess_amount, ['class'=>'form-control','step'=>'0.01','min'=>0]) !!}<p class="help-block">@lang('vrc::lang.excess_help')</p></div></div>
        </div>
        <div class="form-group">{!! Form::label('notes', __('vrc::lang.notes').':') !!}{!! Form::textarea('notes', optional($claim)->notes, ['class'=>'form-control','rows'=>2]) !!}</div>
    </div>
    <div class="modal-footer"><button type="submit" class="btn btn-primary">@lang('messages.save')</button><button type="button" class="btn btn-default" data-dismiss="modal">@lang('messages.close')</button></div>
    {!! Form::close() !!}
</div></div>
