@php $category = $row->client?->client_profile?->project_category; // $value contains raw_data from the column binding // raw_data structure: ['clients' => [...], 'project' => [...]] $rawData = $value ?? $row->raw_data ?? []; $projectData = $rawData['project'] ?? []; // Get project info from raw_data $duration = $projectData['duration'] ?? null; $cashflowAmount = $projectData['cashflow_amount'] ?? null; $totalPropertyValue = $projectData['total_property_value'] ?? null; $propertyZipcode = $projectData['property_zipcode'] ?? null; $projectCategoryId = $projectData['category'] ?? null; $monthlyConsoAmount = $projectData['monthly_conso_amount'] ?? null; $monthlyImmoAmount = $projectData['monthly_immo_amount'] ?? null; $othersDebtsAmount = $projectData['others_debts_amount'] ?? null; // Debt counts and amounts $debtsConsoCount = $projectData['debts_conso_count'] ?? 0; $debtsImmoCount = $projectData['debts_immo_count'] ?? 0; $crdConso = $projectData['debts_conso_amount'] ?? 0; $crdImmo = $projectData['debts_immo_amount'] ?? 0; $crdTotal = $projectData['credit_amount'] ?? ($crdConso + $crdImmo); // Get primary client info from clients array $clientsData = $rawData['clients'] ?? []; $primaryClient = $clientsData[0] ?? []; $coClient = $clientsData[1] ?? null; $totalIncome = 0; foreach ($clientsData as $client) { $totalIncome += $client['total_income'] ?? 0; } $totalClaims = $primaryClient['total_claims'] ?? null; // Residential status $isOwner = $totalPropertyValue && $totalPropertyValue > 0; // Unique ID for collapse $collapseId = 'project-collapse-' . ($row->id ?? uniqid()); @endphp
{{-- Project Category Badge --}} @if($category)
{{ $category->name }}
@elseif($projectCategoryId)
{{ $projectCategoryId == 1 ? __('Regroupement de crédits') : __('Crédit conso') }}
@endif {{-- Collapsible Summary Header --}}
CRD {{ number_format($crdTotal, 0) }}€
{{ $isOwner ? 'Proprio' : 'Loc.' }}
@if($totalIncome > 0)
Rev. {{ number_format($totalIncome/1000, 0) }}k€
@endif
{{-- Collapsible Mini Table --}}
{{-- Statut --}} {{-- Crédits Conso --}} {{-- Crédits Immo --}} {{-- CRD Total --}} {{-- Revenus --}} @if($totalIncome > 0) @endif {{-- Durée --}} @if($duration) @endif {{-- Trésorerie --}} @if($cashflowAmount && $cashflowAmount > 0) @endif {{-- Valeur Bien --}} @if($totalPropertyValue && $totalPropertyValue > 0) @endif {{-- Code Postal --}} @if($propertyZipcode) @endif {{-- Charges --}} @if($totalClaims && $totalClaims > 0) @endif {{-- Co-emprunteur --}} @if($coClient) @endif
@if($isOwner) @else @endif {{ __('Statut résidentiel') }} {{ $isOwner ? __('Propriétaire') : __('Locataire') }}
{{ __('Conso') }} {{ $debtsConsoCount }} @if($crdConso > 0) {{ number_format($crdConso, 0) }}€ @endif
{{ __('Immo') }} {{ $debtsImmoCount }} @if($crdImmo > 0) {{ number_format($crdImmo, 0) }}€ @endif
{{ __('CRD') }} {{ number_format($crdTotal, 0) }}€
{{ __('Revenus') }} {{ number_format($totalIncome, 0, ',', ' ') }}€
{{ __('Durée') }} {{ $duration }} mois
{{ __('Trés.') }} {{ number_format($cashflowAmount/1000, 0) }}k€
{{ __('Bien') }} {{ number_format($totalPropertyValue/1000, 0) }}k€
{{ __('CP') }} {{ $propertyZipcode }}
{{ __('Charges') }} {{ number_format($totalClaims, 0, ',', ' ') }}€
{{ __('Co-emp') }} {{ __('Oui') }}