@extends('layout.layoutAdmin') @section('content')
@if($bien->prix_bas && $bien->prix_moyen && $bien->prix_haut) {{-- Affichage clair que l'estimation existe (lecture seule) --}}
Estimation finie

Bas : {{ number_format($bien->prix_bas ?? 0, 0, ',', ' ') }} € — Moyen : {{ number_format($bien->prix_moyen ?? 0, 0, ',', ' ') }} € — Haut : {{ number_format($bien->prix_haut ?? 0, 0, ',', ' ') }} €

Envoyée le {{ $bien->estimation_sent_at ? $bien->estimation_sent_at->format('d/m/Y H:i') : $bien->updated_at->format('d/m/Y H:i') }} @if(!empty($bien->estimation_sent_by)) par {{ optional($bien->estimationSender)->name ?? '—' }} @endif

@endif {{-- SECTION CLIENT --}}

Informations du client

Nom

{{ $bien->client->nom }} {{ $bien->client->prenom }}

Date de création

{{ $bien->created_at->format('d/m/Y') }}

Email

{{ $bien->client->email }}

Téléphone

{{ $bien->client->telephone }}

{{-- CLASSIFICATION --}}

Classification du bien

Classification actuelle

@if($bien->classification)

{{ $bien->classification->nom }}

@else

Aucune classification définie

@endif
@csrf @method('PUT')
@if($bien->typeBien === 'appartement' && $bien->appartements)

Appartement - Surfaces

Surface Carrez

{{ $bien->appartements->surfaceCarrez }} m²

Surface habitable

{{ $bien->appartements->surfaceHabitable }} m²

Surface extérieur

{{ $bien->appartements->surfaceExterieur }} m²

@endif {{-- SECTION BIEN --}}

Informations générales du bien

Adresse

{{ $bien->adresse }}

Type

{{ ucfirst($bien->typeBien) }}

@if($bien->prix_bas || $bien->prix_moyen || $bien->prix_haut)

Prix bas

{{ number_format($bien->prix_bas, 0, ',', ' ') }} €

Prix moyen

{{ number_format($bien->prix_moyen, 0, ',', ' ') }} €

Prix haut

{{ number_format($bien->prix_haut, 0, ',', ' ') }} €

@endif
{{-- SECTION SPÉCIFIQUE APPARTEMENT --}} @if($bien->typeBien === 'appartement' && $bien->appartements)

Appartement - Général

Type appartement

{{ $bien->appartements->typeAppartement }}

Nombre de pièces

{{ $bien->appartements->nbPieces }}

Nombre de chambres

{{ $bien->appartements->nbChambres }}

Salles de bains

{{ $bien->appartements->nbSdb }}

Étage du bien

{{ $bien->appartements->etageBien }}

Étage de l'immeuble

{{ $bien->appartements->etageImmeuble }}

Vue

{{ $bien->appartements->vueBien }}

Cuisine

{{ $bien->appartements->cuisine }}

Expositions

@php $labels = [ 'nord' => 'Nord', 'nordEst' => 'Nord-Est', 'est' => 'Est', 'sudEst' => 'Sud-Est', 'sud' => 'Sud', 'sudOuest' => 'Sud-Ouest', 'ouest' => 'Ouest', 'nordOuest' => 'Nord-Ouest', ]; @endphp @foreach($labels as $field => $label) @if($bien->expositions && $bien->expositions->$field == 1) {{ $label }} @endif @endforeach @if(!$bien->expositions || collect($labels)->filter(fn($l, $f) => $bien->expositions->$f == 1)->isEmpty()) N/A @endif

@endif @if($bien->typeBien === 'appartement' && $bien->appartements)

Appartement - État & Qualité

Bruit

{{ $bien->appartements->bruit }}

Luminosité

{{ $bien->appartements->luminosité }}

DPE

{{ $bien->appartements->DPE }}

État d'occupation

{{ $bien->appartements->etatOccupation }}

État du bien

{{ $bien->appartements->etatBien }}

Qualité rapport

{{ $bien->appartements->qualiteRapport }}

Appartement - immeuble

Année construction

{{ $bien->appartements->anneeConstruction }}

Standing

{{ $bien->appartements->standing }}

Ravalement façade

{{ $bien->appartements->ravalementFacade }}

État toiture

{{ $bien->appartements->etatToiture }}

État parties communes

{{ $bien->appartements->etatPartiesCommunes }}

Commodités transport

{{ $bien->appartements->commoditésTransport }}

@if($bien->appartements->precisions)

Précisions

{{ $bien->appartements->precisions }}

@endif

Logement vente

{{ $bien->appartements->logementVente }}

Quand vendre

{{ $bien->appartements->quandVendre }}

@endif {{-- SECTION SPÉCIFIQUE MAISON --}} @if($bien->typeBien === 'maison' && $bien->maisons)

Maison - Général

Type maison

{{ $bien->maisons->typeMaison }}

Autre type

{{ $bien->maisons->autreType }}

Nombre de pièces

{{ $bien->maisons->nbPieces }}

Nombre de chambres

{{ $bien->maisons->nbChambres }}

Salles de bains

{{ $bien->maisons->nbSdb }}

Vue

{{ $bien->maisons->vueBien }}

Terrain

{{ $bien->maisons->terrain }}

Piscine

{{ $bien->maisons->piscine }}

Année construction

{{ $bien->maisons->anneeConstruction }}

Standing

{{ $bien->maisons->standing }}

Ravalement façade

{{ $bien->maisons->ravalementFacade }}

État toiture

{{ $bien->maisons->etatToiture }}

État parties communes

{{ $bien->maisons->etatPartiesCommunes }}

Commodités transport

{{ $bien->maisons->commoditesTransport }}

Précisions

{{ $bien->maisons->precisions }}

Logement vente

{{ $bien->maisons->logementVente }}

Quand vendre

{{ $bien->maisons->quandVendre }}

@endif {{-- Éléments spécifiques aux appartements --}} @if($bien->appartements->count())

Appartement - Lot Supplémentaires

@if($bien->appartements->lotSupp) {{-- Parkings --}} @if($bien->appartements->lotSupp->nbParking > 0)

Parkings

{{ $bien->appartements->lotSupp->nbParking }}

@endif {{-- Box --}} @foreach(['boxe1', 'boxe2', 'boxe3'] as $box) @if(!empty($bien->appartements->lotSupp->$box))

{{ ucfirst($box) }}

{{ $bien->appartements->lotSupp->$box }} m²

@endif @endforeach {{-- Caves --}} @foreach(['cave1', 'cave2', 'cave3'] as $cave) @if(!empty($bien->appartements->lotSupp->$cave))

{{ ucfirst($cave) }}

{{ $bien->appartements->lotSupp->$cave }} m²

@endif @endforeach @else

Aucun lot supplémentaire

@endif
{{-- Parties communes --}} @if($bien->appartements->PartiesCommunes)

Parties Communes

Ascenseur

{{ $bien->appartements->PartiesCommunes->ascenseur ? 'Oui' : 'Non' }}

Jardin

{{ $bien->appartements->PartiesCommunes->jardin ? 'Oui' : 'Non' }}

Piscine

{{ $bien->appartements->PartiesCommunes->piscine ? 'Oui' : 'Non' }}

Local à vélos

{{ $bien->appartements->PartiesCommunes->local_velo ? 'Oui' : 'Non' }}

@if($bien->appartements->PartiesCommunes->autre)

Autre

{{ $bien->appartements->PartiesCommunes->autre }}

@endif
@endif @endif {{-- Éléments spécifiques aux maisons --}} @if($bien->maisons) @foreach($bien->maisons as $maison)

Maison - Éléments supplémentaires

@if($maison->elementsSupp->count())
@foreach($maison->elementsSupp as $element)

{{ $element->nom }}

{{ $element->pivot->valeur ?? 'N/A' }}

@endforeach
@else

Aucun élément supplémentaire

@endif

Extérieur

@if($maison->exterieur->count())
@foreach($maison->exterieur as $ext)

{{ $ext->nom }}

{{ $ext->pivot->valeur ?? 'N/A' }}

@endforeach
@else

Aucun élément extérieur

@endif
@endforeach @endif
@csrf

Notes :

{{-- Remplace ton ancienne condition par celle-ci --}} @if(empty($bien->prix_bas) && empty($bien->prix_moyen) && empty($bien->prix_haut)) {{-- Formulaire (inchangé ou ta version stylée) --}}

Estimation du bien

@csrf
@endif
@endsection