66 lines
4.0 KiB
PHP
66 lines
4.0 KiB
PHP
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
@php
|
|
$isEdit = !empty($relation);
|
|
$action = $isEdit
|
|
? action([\App\Http\Controllers\HoldingController::class, 'updateRelation'], [$relation->id])
|
|
: action([\App\Http\Controllers\HoldingController::class, 'storeRelation']);
|
|
@endphp
|
|
{!! Form::open(['url' => $action, 'method' => $isEdit ? 'put' : 'post', 'id' => 'holding_relation_form']) !!}
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal"><span>×</span></button>
|
|
<h4 class="modal-title">
|
|
{{ $isEdit ? __('lang_v1.holding_edit_relation') : __('lang_v1.holding_add_entity_relationship') }}
|
|
</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="form-group">
|
|
{!! Form::label('owner_entity_id', __('lang_v1.holding_owner_entity') . ':*') !!}
|
|
{!! Form::select('owner_entity_id', $entities, $relation->owner_entity_id ?? null, ['class' => 'form-control select2', 'required', 'placeholder' => __('lang_v1.holding_owner_entity')]) !!}
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="form-group">
|
|
{!! Form::label('related_entity_id', __('lang_v1.holding_related_entity') . ':*') !!}
|
|
{!! Form::select('related_entity_id', $entities, $relation->related_entity_id ?? null, ['class' => 'form-control select2', 'required', 'placeholder' => __('lang_v1.holding_related_entity')]) !!}
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="form-group">
|
|
{!! Form::label('relation_type', __('lang_v1.type') . ':*') !!}
|
|
{!! Form::select('relation_type', $relationTypes, $relation->relation_type ?? 'subsidiary', ['class' => 'form-control select2', 'required']) !!}
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="form-group">
|
|
{!! Form::label('contract_ref', __('lang_v1.holding_contract_ref') . ':') !!}
|
|
{!! Form::text('contract_ref', $relation->contract_ref ?? null, ['class' => 'form-control']) !!}
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="form-group">
|
|
{!! Form::label('contract_start_date', __('lang_v1.holding_start_date') . ':') !!}
|
|
{!! Form::text('contract_start_date', !empty($relation->contract_start_date) ? format_date($relation->contract_start_date) : null, ['class' => 'form-control holding-date-picker', 'readonly', 'autocomplete' => 'off']) !!}
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="form-group">
|
|
{!! Form::label('contract_end_date', __('lang_v1.holding_end_date') . ':') !!}
|
|
{!! Form::text('contract_end_date', !empty($relation->contract_end_date) ? format_date($relation->contract_end_date) : null, ['class' => 'form-control holding-date-picker', 'readonly', 'autocomplete' => 'off']) !!}
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<label>{!! Form::checkbox('is_active', 1, $relation->is_active ?? true) !!} @lang('lang_v1.holding_status_active')</label>
|
|
</div>
|
|
</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>
|