@extends('layouts.app') @php use App\Enums\OptionState; use App\Enums\PriceType; use App\Enums\SurfaceType; use App\Enums\TaskState; @endphp @section('content')

Fiche client

{{ $client->fullName() }}

Informations client
  • Civilité : {{ $client->civility?->label() ?? '-' }}
  • Nom : {{ $client->lastname ?? '-' }}
  • Prénom : {{ $client->firstname ?? '-' }}
  • Email : {{ $client->email ?? '-' }}
  • @if($client->birthdate)
  • Date de naissance : {{ $client->birthdate->format('d/m/Y') }}
  • @endif @if($client->birthplace)
  • Lieu de naissance : {{ $client->birthplace }}
  • @endif @if($client->phones && $client->phones->count() > 0)
  • Téléphone : @foreach($client->phones as $phone)
    {{ format_phone_display($phone->value) }} {{ $phone->type?->label() ?? '-' }}
    @endforeach
  • @endif @if($client->address)
  • Adresse : {{ $client->address->line_1 ?? '' }} @if($client->address->line_2)
    {{ $client->address->line_2 }} @endif
  • @if($client->address->city)
  • Ville : {{ $client->address->city }}
  • @endif @if($client->address->zip_code)
  • Code postal : {{ $client->address->zip_code }}
  • @endif @endif
  • Date de création du client : {{ $clientCreationDate->format('d/m/Y') }}
  • Statut du dernier dossier : @if($lastStatus) {{ $lastStatus->label() }} @else Aucun dossier @endif
Commentaire

@if($client->notes) {!! nl2br(e($client->notes)) !!} @else Aucun commentaire @endif

Dossiers actifs ({{ $dossiersActifs->count() }})
@if($dossiersActifs->count() > 0)
@foreach($dossiersActifs as $option) @php $lot = $option->product; $program = $lot ? $lot->program : null; $state = $option->state; // Fiscalité $fiscalites = $program ? $program->fiscalites->pluck('type')->map(fn($f) => $f->label())->toArray() : []; $fiscaliteLibelle = !empty($fiscalites) ? implode(', ', $fiscalites) : '-'; // Typologie $typologie = $lot && $lot->type ? $lot->type->label() : '-'; // Prix $prixTTC = $lot ? $lot->prices->where('type', 'prix_ttc')->first() : null; $prix = $prixTTC ? number_format($prixTTC->value, 0, ',', ' ') . ' €' : '-'; // Date de réservation et réservation $dateReservation = null; $reservation = null; $currentTask = null; $workflowStatus = null; if ($state === OptionState::CONFIRMED) { $reservation = $option->reservation; if ($reservation) { $dateReservation = $reservation->created_at; $currentTask = $reservation->task; if ($currentTask) { $workflowStatus = $currentTask->name; } else { // Récupérer la tâche courante depuis taskReservations $currentTaskReservation = $reservation->taskReservations ->where('state', TaskState::EN_COURS) ->first(); if ($currentTaskReservation && $currentTaskReservation->task) { $currentTask = $currentTaskReservation->task; $workflowStatus = $currentTask->name; } } } else { $dateReservation = $option->updated_at; } } @endphp @if($program) @endif @endforeach
Programme Lot Fiscalité associée Typologie Statut du dossier Date pose d'option Date de réservation Prix Action
@if($program->slug) {{ $program->name }} @else {{ $program->name }} @endif Lot n°{{ $lot->number ?? '-' }} {{ $fiscaliteLibelle }} {{ $typologie }} @if($state === OptionState::CONFIRMED && $workflowStatus) {{ $workflowStatus }} @else {{ $state->label() }} @endif {{ $option->created_at->format('d/m/Y') }} {{ $dateReservation ? $dateReservation->format('d/m/Y') : '-' }} {{ $prix }} @if($state === OptionState::CONFIRMED && $reservation) Voir @else Voir @endif
@else

Aucun dossier actif pour ce client

@endif
Historique des ventes ({{ $historiqueVentes->count() }})
@if($historiqueVentes->count() > 0)
@foreach($historiqueVentes as $option) @php $lot = $option->product; $program = $lot ? $lot->program : null; $state = $option->state; // Prix $prixTTC = $lot ? $lot->prices->where('type', 'prix_ttc')->first() : null; $prix = $prixTTC ? number_format($prixTTC->value, 0, ',', ' ') . ' €' : '-'; // Date d'archivage (dernière modification) $dateArchivage = $option->updated_at; @endphp @if($program) @endif @endforeach
Date d'archivage Programme Lot Statut Prix Action
{{ $dateArchivage->format('d/m/Y') }} @if($program->slug) {{ $program->name }} @else {{ $program->name }} @endif Lot n°{{ $lot->number ?? '-' }} {{ $state->label() }} {{ $prix }} Voir
@else

Aucun dossier archivé pour ce client

@endif
@push('scripts') @endpush @endsection