{!! Form::hidden('id', null, ['id' => 'id']) !!} {!! Form::hidden('client_id', null, ['id' => 'client_id']) !!} @if (isset($active_record) and !isset($history)) {!! Form::hidden('type_id', null, ['id' => 'type_id', 'data-discount' => $type_discount, 'data-factoring' => $type_factoring, 'data-invoice_discount' => $type_invoice_discount, 'data-instalment_sale_product' => $instalment_sale_product, 'data-debtor' => $type_debtor, 'data-supplier' => $type_supplier, 'data-sum_assets_field' => $type_sum_assets_field]) !!} {!! Form::hidden('asset_type_id', null, ['id' => 'asset_type_id', 'data-discount_right' => $asset_discount_right, 'data-vehicle' => $asset_vehicle, 'data-equipment' => $asset_equipment, 'data-invoice' => $asset_invoice, 'data-cheque' => $asset_cheque, 'data-property' => $asset_property]) !!} @endif {!! Form::formattedDate('confirm_date', ['type'=> 'hidden', 'id' => 'confirm_date']) !!} {!! Form::hidden('confirmed', null, ['id' => 'confirmed']) !!}
@if (isset($active_record))
Agreement Code:
{{ $agreement->code }}
Status:
{{ $agreement->status->description }}
Created at:
{!! DisplayHelper::formatDateTime($agreement->created_at) !!}
@if ($agreement->capital_client_invoice)
Invoice No:
{{ $agreement->capital_client_invoice->invoice_string }}
@endif
@if ($agreement->confirmed)
confirmed: {!! App\Helpers\DisplayHelper::formatDate($agreement->confirm_date) !!}
@endif @if ($agreement->closed)
closed: {!! DisplayHelper::formatDate($agreement->close_date) !!}
@endif @if ($agreement->rescheduled)
rescheduled: {!! DisplayHelper::formatDate($agreement->reschedule_date) !!}
@endif @if ($agreement->discounted)
discounted: {!! DisplayHelper::formatDate($agreement->discount_date) !!}
@endif @if ($agreement->capital_client_invoice)
invoiced: {!! DisplayHelper::formatDate($agreement->capital_client_invoice->invoice_date) !!}
@endif
@if ($agreement->discounted)
Discount Bank:
{{ $agreement->discount_bank_account->bank_name_account }}
@endif
@if ($agreement->discount_product) @include('agreement.dashboard-discount') @elseif ($agreement->lease_product) @include('agreement.dashboard-lease') @elseif ($agreement->loan_product) @include('agreement.dashboard-loan') @elseif ($agreement->instalment_sale_product) @include('agreement.dashboard-instalment-sale') @elseif ($agreement->loan_fl_product) @include('agreement.dashboard-loan-fl') @else @include('agreement.dashboard-standard') @endif
Amount
@endif
{{-- Disable type selection for existing agreement --}} @if (isset($active_record))
Agreement Type:
{{ $agreement->type->description }}
@if ($active_record->provider) @if ($active_record->provider->debtor)
{{-- see FormMacroServiceProvider for fancySelect parameters --}} {!! Form::fancySelect( 'provider_id', $debtor_list, ['class' => 'form-control provider-select', 'data-debtor-select' => 'true', 'required', 'v-bind:disabled' => 'disable_input'], ['facilities', 'agreement_types'], $active_record->provider_id, false, null, ['facilities']) !!}
@elseif ($active_record->provider->supplier) {{-- Enable supplier selection for asset type = equipment or vehicles --}}
{!! Form::fancySelect( 'provider_id', $supplier_list, ['class' => 'form-control provider-select', 'data-supplier-select' => 'true', 'required', 'v-bind:disabled' => 'disable_input'], ['facility_discount_percent', 'payment_term_id', 'term_statement', 'term_days', 'vat_registered'], $active_record->provider_id, false) !!}
@elseif ($active_record->provider->associate) {{-- Enable associate selection for asset type = property --}}
{!! Form::select( 'provider_id', $associate_list, null, ['class' => 'form-control provider-select associate-select', 'required', 'v-bind:disabled' => 'disable_input']) !!}
@endif @endif @else {{-- Enable type selection for new agreement --}}
{!! Form::label('type_id', 'Agreement type:', ['class' => 'control-label col-sm-3']) !!}
{!! Form::fancySelect( 'type_id', $type_list, ['class' => 'form-control', 'required' => 'required'], ['discount', 'lease_product', 'instalment_sale_product', 'factoring', 'invoice_discount', 'asset_type_ids', 'provider_description', 'debtor', 'supplier', 'associate', 'client_facility_id', 'client_facility_interest_rate', 'client_facility_discount_rate', 'sum_assets_field']) !!}

{{-- Enable asset type selection for agreements that have more than one asset type option hilbit-agreement-vue.js handles select_asset_type --}}
{!! Form::label('asset_type_id', 'Asset type:', ['class' => 'control-label col-sm-3']) !!}
{{-- Add data attributes 'vehicle' and 'equipment' to each selection --}} {!! Form::fancySelect('asset_type_id', $asset_type_list, ['class' => 'form-control', 'required'], ['vehicle', 'equipment', 'invoice', 'property', 'cheque', 'discount_right', 'agreement_description']) !!}
{{-- Enable debtor selection for asset type = invoice or cheque or right--}}
{!! Form::fancySelect('provider_id', $debtor_list, ['class' => 'form-control provider-select', 'v-bind:disabled' => 'disable_debtor', 'data-debtor-select' => 'true', 'required'], ['facilities', 'agreement_types'], null, false, null, ['facilities']) !!}
{{-- Enable supplier selection for asset type = equipment or vehicles --}}
{!! Form::label('provider_id', 'Supplier:', ['class' => 'control-label col-sm-3']) !!}
{!! Form::fancySelect('provider_id', $supplier_list, ['class' => 'form-control provider-select', 'data-supplier-select' => 'true', 'v-bind:disabled' => 'disable_supplier', 'required'], ['facility_discount_percent', 'payment_term_id', 'term_statement', 'term_days', 'vat_registered'], null, false) !!}
{{-- Enable associate selection for asset type = property --}}
{!! Form::label('provider_id', 'Attorney:', ['class' => 'control-label col-sm-3']) !!}
{!! Form::select('provider_id', $associate_list, null, ['class' => 'form-control provider-select associate-select', 'v-bind:disabled' => 'disable_associate', 'required']) !!}
{{-- Enable creation of invoices asset: hilbit-agreement-vue.js handles create_assets --}}
{{-- Enable creation of property asset: hilbit-agreement-vue.js handles create_property --}}
{{-- Enable creation of cheque asset for cheque discounting agreement type hilbit-agreement-vue.js handles create_cheque --}}
{{-- Enable creation of right asset for right discounting agreement type hilbit-agreement-vue.js handles create_right --}}

@endif
@if (!is_null($agreement->type_id) && $agreement->type_id <> 0) @if ($agreement->discount_product) @include('agreement.form-discount') @elseif ($agreement->lease_product) @include('agreement.form-lease') @elseif ($agreement->discount_pv_product) @include('agreement.form-discount-pv') @elseif ($agreement->single_payment_product) @include('agreement.form-single-payment') @elseif ($agreement->loan_product) @include('agreement.form-loan') @elseif ($agreement->instalment_sale_product) @include('agreement.form-instalment-sale') @elseif ($agreement->loan_fl_product) @include('agreement.form-loan-fl') @endif @endif

@if ($can_update)
{!! Form::submit($submitButtonText, ['class' => 'btn btn-success btn-sm']) !!}
@endif