@section('title', $title) @php addVendors(['formrepeater']); @endphp @if ($kyc_document->id) @if(request()->route()->getName() == 'admin.contract-doc-controls.edit') {!! Form::model($kyc_document, ['route' => ['admin.contract-doc-controls.update', $kyc_document], 'method' => 'PUT', 'class' => 'repeater']) !!} @else {!! Form::model($kyc_document, ['route' => ['admin.invoice-doc-controls.update', $kyc_document], 'method' => 'PUT', 'class' => 'repeater']) !!} @endif @else @if(request()->route()->getName() == 'admin.contract-doc-controls.create') {!! Form::open(['route' => 'admin.contract-doc-controls.store', 'method' => 'POST', 'class' => 'repeater']) !!} @else {!! Form::open(['route' => 'admin.invoice-doc-controls.store', 'method' => 'POST', 'class' => 'repeater']) !!} @endif @endif @csrf
{!! Form::text('title', null, ['class' => 'form-control', 'placeholder' => 'Enter Title']) !!}
{!! Form::select('client_type', ['Person' => 'Person', 'Company' => 'Company', 'Both' => 'Both'], null, ['class' => 'form-control', 'data-kt-select2' => 'true']) !!}
{{-- types --}}
{{ Form::label('contract_type_ids', __('Contract Type'), ['class' => 'col-form-label']) }} {!! Form::select('contract_type_ids[]', $contract_types, $kyc_document->contractTypes->pluck('id')->toArray(), ['class' => 'form-select', 'data-kt-select2' => 'true', 'multiple', 'data-placeholder' => __('Select Type')]) !!}
{{-- categories --}}
{{ Form::label('contract_category_ids', __('Contract Category'), ['class' => 'col-form-label']) }} {!! Form::select('contract_category_ids[]', $contract_categories, $kyc_document->contractCategories->pluck('id')->toArray(), ['class' => 'form-select', 'data-kt-select2' => 'true', 'multiple', 'data-placeholder' => __('Select Category')]) !!}
@if(request()->route()->getName() == 'admin.invoice-doc-controls.create' || request()->route()->getName() == 'admin.invoice-doc-controls.edit' ) {{-- Contract --}}
{{ Form::label('contract_ids', __('Contract'), ['class' => 'col-form-label']) }} {!! Form::select('contract_ids[]', $contracts ?? [], $kyc_document->contracts->pluck('id')->toArray(), [ 'class' => 'form-select', 'data-kt-select2' => 'true', 'multiple', 'data-placeholder' => __('Select Contract'), 'data-allow-clear' => 'true', 'data-remote' => route('resource-select', ['Contract']) ]) !!}
{{-- Invoice Type --}}
{{ Form::label('invoice_type', __('Invoice type'), ['class' => 'col-form-label']) }} {!! Form::select('invoice_type', (['' => 'Both'] + array_combine($invoice_types, $invoice_types)), $kyc_document->invoice_type , ['class' => 'form-select', 'data-kt-select2' => 'true', 'data-placeholder' => __('Both'), 'data-allow-clear' => 'true']) !!}
@endif
{!! Form::text('required_at',null, ['class' => 'form-control flatpickr']) !!}
{!! Form::select('required_at_type', ['Before' => 'Before', 'After' => 'After', 'On' => 'On'], null, ['class' => 'form-control', 'data-kt-select2' => 'true']) !!}
{!! Form::select('status', ['1' => 'Active', '0' => 'Inactive'], null, ['class' => 'form-control', 'data-kt-select2' => 'true']) !!}
{!! Form::select('is_mendatory', ['1' => 'Yes', '0' => 'No'], null, ['class' => 'form-control', 'data-kt-select2' => 'true']) !!}
{!! Form::textarea('description', null, ['class' => 'form-control', 'rows' => 2]) !!}
{!! Form::text('expiry_date_title', null, ['class' => 'form-control', 'rows' => 2]) !!}
{!! Form::select('is_expiry_date_required', ['0' => 'No', '1' => 'Yes'], null, ['class' => 'form-control', 'data-kt-select2' => 'true']) !!}
{{-- signatures --}}
{!! Form::number('signatures_required', $kyc_document->signatures_required, ['class' => 'form-control', 'rows' => 2]) !!}
{{-- end signatures --}} {{-- stamps --}}
{!! Form::number('stamps_required', $kyc_document->stamps_required, ['class' => 'form-control', 'rows' => 2]) !!}
{{-- end stamps --}} {{-- Having Refrence Id --}}
{{-- End Having Refrence Id --}} @if(request()->route()->getName() == 'admin.invoice-doc-controls.create' || request()->route()->getName() == 'admin.invoice-doc-controls.edit' ) {{-- is Global --}}
{{-- End is Global --}} @endif

{{ __('Document Fields') }}

@forelse ($kyc_document->fields ?? [] as $field)
{!! Form::text('fields[][label]', $field['label'], ['class' => 'form-control']) !!} {!! Form::hidden('fields[][id]', @$field['id'], ['class' => 'form-control']) !!}
{!! Form::select('fields[][type]', array_combine($types, array_map('ucwords',$types)), $field['type'], ['class' => 'form-control']) !!}
{!! Form::select('fields[][is_required]', ['Not Required', 'Required',], $field['is_required'], ['class' => 'form-control']) !!}
@empty
{!! Form::text('fields[][label]', null, ['class' => 'form-control']) !!}
{!! Form::select('fields[][type]', array_combine($types, array_map('ucwords',$types)), null, ['class' => 'form-control']) !!}
{!! Form::select('fields[][is_required]', ['Required', 'Not Required'], null, ['class' => 'form-control']) !!}
@endforelse
@push('scripts') @endpush