@extends('layouts.pdf') @section('content')

{{ now()->format('d/m/Y') }}

GRILLE D'ETUDE: {{ $client_names }}

@if(count($clients) > 1) @endif
AGE EMPRUNTEUR: {{ data_get($clients, '0.age', '') }} SITUATION FAM: {{ data_get($clients, '0.matrimonial_situation', '') }}
AGE CO-EMPRUNTEUR: {{ data_get($clients, '1.age', '') }} ENFANTS À CHARGE: {{ data_get($infants, 'count') }}
ANCIENNETÉ PRO EMPRUNTEUR: {{ data_get($clients, '0.employment_start_date', '') }} @if(data_get($infants, 'ages')) AGE DES ENFANTS: @endif {{ data_get($infants, 'ages') }}
PROFESSION EMPRUNTEUR: {{ data_get($clients, '0.employment_profession', '') }}
ANCIENNETÉ PRO CO-EMPRUNTEUR: {{ data_get($clients, '1.employment_start_date', '') }}
PROFESSION CO-EMPRUNTEUR: {{ data_get($clients, '1.employment_profession', '') }}

{{ __('Income') }}

@foreach($clients as $i => $client) @endforeach @foreach($clients as $i => $client) @endforeach @foreach([__('Salary/Pension') => 'monthly', __('Rentals Revenue') => 'property_income', __('Family Allowance') => 'family_allowance'] as $name => $key) @continue(! (data_get($clients, "0.income.$key") || (data_get($clients, "1.income.$key")))) @foreach($clients as $i => $client) @endforeach @endforeach @if(data_get($clients, '0.income.has_other_income') || data_get($clients, '1.income.has_other_income')) @for($inc = 1; $inc <= 5; $inc++) @php($ic = $inc == 1? '' : $inc) @if(data_get($clients, "0.income.other_income{$ic}_id", false) || data_get($clients, "1.income.other_income{$ic}_id", false)) @foreach($clients as $i => $client) @endforeach @endif @endfor @endif
{!! strip_tags(data_get($clients, "$i.fullname")) !!}
BS AI
{{ $name }} {{ str()->formatDecimal(data_get($client, "income.$key"), 2, ',', '') ?: '' }} {{ str()->formatDecimal(data_get($client, "external_data.income.$key"), 2, ',', '') ?: '' }}
{{ data_get($client, "income.other_income{$ic}_name") }} {{ str()->formatDecimal(data_get($client, "income.other$inc"), 2, ',', '') ?: '' }} {{ str()->formatDecimal(data_get($client, "external_data.income.other$inc"), 2, ',', '') ?: '' }}
@if(count($claims))

{{ __('Claims') }}

@foreach($claims as $i => $claim) @endforeach
{{ __('Claim Type') }} {{ __('Creditor') }} {{ __('Monthly') }}
{{ data_get($claim, 'claim_type') }} {{ data_get($claim, 'creditor') }} {{ str()->formatDecimal(data_get($claim, 'monthly'), 2, ',', '') }}
@endif

{{ __('Debts') }}

@foreach($debts as $i => $debt) @if(data_get($debts, ($i + 1)) && data_get($debt, 'recovery') !== data_get($debts, ($i + 1).'.recovery')) @endif @if(! data_get($debts, ($i + 1)) && data_get($debt, 'recovery')) @endif @endforeach @if(count($temp_debts ?? [])) @endif @foreach($temp_debts as $i => $debt) @endforeach
No Ref Organisme Type Mt initial Début Objet Taux Mens. KRD Reprise
{{ $i + 1 }} {{ data_get($debt, 'ref') }} {{ data_get($debt, 'creditor') }} {{ data_get($debt, 'debt_type') }} {{ str()->formatDecimal(data_get($debt, 'initial_capital'), 2, ',', '') }} {{ data_get($debt, 'start_at_short') }} {{ data_get($debt, 'object') }} {{ str()->formatDecimal( data_get($debt, 'rate'), 2, ',', '') }} {{ str()->formatDecimal(data_get($debt, 'monthly'), 2, ',', '') }} {{ str()->formatDecimal(data_get($debt, 'remaining_capital'), 2, ',', '') }} {{ data_get($debt, 'recovery') ? __('Yes') : __('No') }}
Total {{ str()->formatDecimal(data_get($debt_totals, 'monthly_no_recovery'), 2, ',', '') }} {{ str()->formatDecimal(data_get($debt_totals, 'remaining_capital_no_recovery'), 2, ',', '') }}
{{ data_get($debt, 'recovery') ? 'À conserver' : 'À reprendre' }}
Total {{ str()->formatDecimal(data_get($debt_totals, 'monthly_recovery'), 2, ',', '') }} {{ str()->formatDecimal(data_get($debt_totals, 'remaining_capital_recovery'), 2, ',', '') }}
{{ data_get($debt, 'ref') }} {{ data_get($debt, 'creditor') }} {{ data_get($debt, 'debt_type') }} {{ str()->formatDecimal(data_get($debt, 'initial_capital'), 2, ',', '') }} {{ data_get($debt, 'start_at_short') }} {{ data_get($debt, 'object') }} {{ str()->formatDecimal(data_get($debt, 'rate'), 2, ',', '') }} {{ str()->formatDecimal(data_get($debt, 'monthly'), 2, ',', '') }} {{ str()->formatDecimal(data_get($debt, 'remaining_capital'), 2, ',', '') }} {{ data_get($debt, 'recovery') ? __('Yes') : __('No') }}
@if(count($overdrafts))

{{ __('Overdrafts') }}

@foreach($overdrafts as $i => $overdraft) @endforeach @if(count($overdrafts)) @endif
{{ __('Bank name') }} {{ __('IBAN') }} {{ __('Amount') }}
{{ data_get($overdraft, 'bank_name') }} {{ data_get($overdraft, 'iban') }} {{ data_get($overdraft, 'ending_balance') }}
Total {{ str()->formatDecimal($total_overdraft, 2, ',', '') }}
@endif @if(count($cashflows))

{{ __('Cashflows') }}

@foreach($cashflows as $i => $cashflow) @endforeach @if(count($cashflows)) @endif
{{ __('Reason') }} {{ __('Amount') }}
{{ data_get($cashflow, 'reason') }} {{ str()->formatDecimal(data_get($cashflow, 'amount'), 2, ',', '') }}
Total {{ str()->formatDecimal($total_cashflow, 2, ',', '') }}
@endif @if(count($properties))

{{ __('Properties') }}

@foreach($properties as $i => $property) @endforeach @if(count($properties)) @endif
{{ __('Property Type') }} {{ __('Property Nature') }} {{ __('Value of purchase') }} {{ __('Estimated value') }} {{ __('Zip Code') }} {{ __('City') }} {{ __('Warranty proposed') }}
{{ data_get($property, 'property_type') }} {{ data_get($property, 'property_nature') }} {{ str()->formatDecimal(data_get($property, 'value_purchase'), 2, ',', '') }} {{ data_get($property, 'value') }} {{ data_get($property, 'address.zip_code', '') }} {{ data_get($property, 'address.city', '') }} {{ data_get($property, 'warranty_proposed') ? __('Yes') : __('No') }}
Total en garantie {{ $total_warranty_property_value }}
@endif {{-- note: [ 'id' => $note->id, 'content' => $note->content, 'created_at' => $note->created_at->format('d/m/Y H:i'), 'created_by' => $note->user?->name_and_surname, ] --}} @if(count($notes))

{{ __('Notes') }}

@endif @foreach($notes->reverse() as $note)
{!! nl2br(strip_tags($note['content'])) !!}
{{ $note['created_by'] }} - {{ $note['created_at'] }}
@endforeach @endsection