@extends('layouts.base') @section('content') @section('breadcrumb') @endsection
@if(session('success')) @endif @if(session('error')) @endif @if ($errors->any()) @endif

{{ $lot->name }}

{{ $program->name }}

{{ $lot->current_state->label() }} @if($lot->is_active) Actif @else Inactif @endif
Informations détaillées
Informations du lot

{{ $lot->number }}

@if($lot->gender)

{{ $lot->gender->label() }}

@endif @php try { $lotType = $lot->type; $lotTypeValid = $lotType && $lotType !== \App\Enums\ProductType::NON_DEFINI; } catch (\Throwable $e) { $lotType = null; $lotTypeValid = false; } @endphp @if($lotTypeValid)

{{ $lotType->label() }} @if($lotType->isPMR()) PMR @endif

@endif @if($lot->floor)

{{ $lot->floor->shortLabel() }}

@endif @if($lot->orientations && $lot->orientations->count() > 0)
@foreach($lot->orientations as $orientation) {{ $orientation->type->label() }} @endforeach
@foreach($lot->orientations as $index => $orientation) {{ $orientation->type->exposureDescription() }}{{ $loop->last ? '' : ' / ' }} @endforeach
@endif @if($lot->tantieme)

{{ $lot->tantieme }}

@endif @if($lot->surfaces && $lot->surfaces->count() > 0)
@foreach($lot->surfaces as $surface)

{{ $surface->type->label() }} {{ number_format($surface->value, 2, ',', ' ') }} m²

@endforeach
@endif

{{ $lot->current_state->label() }}

@if($lot->is_active) Actif @else Inactif @endif

Informations techniques

{{ $lot->id }}

{{ $lot->prices?->count() ?? 0 }} prix

{{ $lot->annexes?->count() ?? 0 }} annexe(s)

@if(isset($formEditor) && $formEditor && $formEditor->fields->count() > 0)
Champs personnalisés
Données spécifiques à cette application
Note : Ces champs ne concernent pas l'affichage sur le site de diffusion. Ils sont uniquement utilisés pour la gestion interne.
@foreach($formEditor->fields as $field) @php $fieldValue = $field->data && isset($field->data->json['value']) ? $field->data->json['value'] : null; @endphp @if($fieldValue !== null && $fieldValue !== '')
@if($field->type === \App\Enums\FieldType::TEXT || $field->type === \App\Enums\FieldType::NUMBER)

{{ $fieldValue }}

@elseif($field->type === \App\Enums\FieldType::CHECKBOX)

@if($fieldValue == '1') Activé @else Désactivé @endif

@elseif($field->type === \App\Enums\FieldType::DATE)

{{ \Carbon\Carbon::parse($fieldValue)->format('d/m/Y') }}

@else

{{ $fieldValue }}

@endif @if($field->description) {{ $field->description }} @endif
@endif @endforeach
@if($formEditor->fields->filter(fn($f) => $f->data && isset($f->data->json['value']) && $f->data->json['value'] !== '')->count() === 0)
Aucune donnée personnalisée renseignée
@endif
@endif @php $salePrices = $lot->prices->filter(function($price) { return in_array($price->type, ['prix_ht', 'prix_ttc', 'prix_tva_5_5', 'prix_tva_10']); }); @endphp @if($salePrices->count() > 0)
Prix de vente
@foreach($salePrices as $price) @endforeach @if($lot->getTotalTravauxReadOnly() > 0 && $lot->getPrixLotTTC() > 0) @endif
Type Montant
@if($price->type_enum) {{ $price->type_enum->label() }} @else Non défini @endif {{ number_format($price->value, 2, ',', ' ') }} €
Prix foncier (Prix TTC - Travaux inclus) {{ number_format($lot->getPrixFoncier(), 2, ',', ' ') }} €
@endif
Prix immo
@php $immoPrices = $lot->prices->filter(function($price) { return in_array($price->type, ['prix_immo_ttc', 'prix_immo_ht']); }); @endphp @if($immoPrices->count() > 0)
@foreach($immoPrices as $price) @endforeach
Type Montant
@php $priceTypeEnum = \App\Enums\PriceType::tryFrom($price->type); @endphp @if($priceTypeEnum) {{ $priceTypeEnum->label() }} @else {{ $price->type }} @endif {{ number_format($price->value, 2, ',', ' ') }} €
@else
Aucun prix immo renseigné
@endif
@php $rentalPrices = $lot->prices->filter(function($price) { return in_array($price->type, ['mensuel_ttc', 'mensuel_ht', 'mensuel_denormandie_ttc', 'mensuel_denormandie_ht', 'mensuel_garage', 'mensuel_parking']); }); @endphp @if($rentalPrices->count() > 0)
Prix de loyer
@foreach($rentalPrices as $price) @endforeach
Type Montant mensuel
@if($price->type_enum) {{ $price->type_enum->label() }} @else Non défini @endif {{ number_format($price->value, 2, ',', ' ') }} € /mois
@endif @php $travauxPrices = $lot->prices->filter(function($price) { return in_array($price->type, ['prix_travaux_eligible', 'prix_travaux_non_eligible']); }); @endphp @if($travauxPrices->count() > 0)
Prix des travaux
@foreach($travauxPrices as $price) @endforeach
Type Montant
@if($price->type_enum) {{ $price->type_enum->label() }} @else Non défini @endif @if($price->read_only) (inclus dans le prix du bien) @endif {{ number_format($price->value, 2, ',', ' ') }} €
@endif @php $fraisPrices = $lot->prices->filter(function($price) { return in_array($price->type, ['prix_cuisine', 'frais_notaire', 'frais_notaire_tva_5_5', 'frais_notaire_tva_10', 'frais_pret', 'frais_gerance', 'frais_mise_copro']); }); @endphp @if($fraisPrices->count() > 0)
Frais et prix supplémentaires
@foreach($fraisPrices as $price) @endforeach
Type Montant
@if($price->type_enum) {{ $price->type_enum->label() }} @else Non défini @endif {{ number_format($price->value, 2, ',', ' ') }} €
@endif @php $chargePrices = $lot->prices->filter(function($price) { return in_array($price->type, ['taxe_fonciere', 'charge_copropriete']); }); @endphp @if($chargePrices->count() > 0)
Charges
@foreach($chargePrices as $price) @endforeach
Type Montant
@if($price->type_enum) {{ $price->type_enum->label() }} @else Non défini @endif {{ number_format($price->value, 2, ',', ' ') }} €
@endif @php // Utilisation des méthodes du modèle Product pour les calculs $calculatedPrices = $lot->getCalculatedPrices(); // Extraire les valeurs pour la compatibilité avec le code existant $prixLotTTC = $calculatedPrices->prix_lot_ttc; $prixLotTVA = $calculatedPrices->prix_lot_tva; $totalAnnexesTTC = $calculatedPrices->total_annexes_ttc; $totalAnnexesTVA = $calculatedPrices->total_annexes_tva; $totalLotEtAnnexes = $calculatedPrices->total_lot_et_annexes; $totalTravaux = $calculatedPrices->total_travaux; $totalFrais = $calculatedPrices->total_frais; $fraisNotaire = $calculatedPrices->frais_notaire; $fraisNotaireTVA = $calculatedPrices->frais_notaire_tva; $totalFraisAvecTVA = $calculatedPrices->total_frais_avec_tva; $totalCharges = $calculatedPrices->total_charges; $totalGeneral = $calculatedPrices->total_general; $totalAvecTVA = $calculatedPrices->total_avec_tva; $fraisNotaireTVA5 = $calculatedPrices->frais_notaire_tva_5_5 ?? 0; $fraisNotaireTVA10 = $calculatedPrices->frais_notaire_tva_10 ?? 0; $isTVA55 = $lot->getPrixLotTVA5_5() > 0; // Total avec TVA 10% spécifique $prixLotTVA10 = $calculatedPrices->prix_lot_tva_10; $totalAvecTVA10 = $calculatedPrices->total_avec_tva_10; $totalFraisAvecTVA10 = $calculatedPrices->total_frais_avec_tva_10; @endphp @if($prixLotTTC > 0 || $prixLotTVA > 0 || $prixLotTVA10 > 0 || $totalAnnexesTTC > 0 || $totalAnnexesTVA > 0 || $totalTravaux > 0 || $totalFrais > 0 || $totalFraisAvecTVA > 0 || $totalCharges > 0)
Totaux
@if($prixLotTTC > 0) @endif @if($totalAnnexesTTC > 0) @endif @if($prixLotTTC > 0 || $totalAnnexesTTC > 0) @endif @if($totalTravaux > 0) @endif @if($totalTravaux > 0 || $totalFrais > 0 || $totalCharges > 0) @endif @if($totalFrais > 0) @endif @if($totalFraisAvecTVA > 0) @endif @if($prixLotTVA10 > 0 && $totalFraisAvecTVA10 > 0) @endif @if($totalFrais > 0) @endif @if($prixLotTVA > 0) @endif @if($prixLotTVA10 > 0) @endif @if($totalCharges > 0) @endif
Prix du lot TTC {{ number_format($prixLotTTC, 2, ',', ' ') }} €
Prix des annexes TTC {{ number_format($totalAnnexesTTC, 2, ',', ' ') }} €
Total lot + annexes TTC {{ number_format($totalLotEtAnnexes, 2, ',', ' ') }} €
Total des travaux + {{ number_format($totalTravaux, 2, ',', ' ') }} €

Total des frais + {{ number_format($totalFrais, 2, ',', ' ') }} €
Frais avec TVA {{ $isTVA55 ? '5.5%' : '10% (LLI)' }} @php $detailNotaire = $isTVA55 ? $fraisNotaireTVA5 : $fraisNotaireTVA10; @endphp @if($detailNotaire > 0)
(dont frais de notaire avec TVA {{ $isTVA55 ? '5.5%' : '10% (LLI)' }} : {{ number_format($detailNotaire, 2, ',', ' ') }} €) @endif
+ {{ number_format($totalFraisAvecTVA, 2, ',', ' ') }} €
Frais avec TVA 10% (LLI) @if($fraisNotaireTVA10 > 0)
(dont frais de notaire avec TVA 10% : {{ number_format($fraisNotaireTVA10, 2, ',', ' ') }} €) @else
(utilise frais de notaire standard : {{ number_format($fraisNotaire, 2, ',', ' ') }} €) @endif
+ {{ number_format($totalFraisAvecTVA10, 2, ',', ' ') }} €
TOTAL GÉNÉRAL (avec frais) {{ number_format($totalGeneral, 2, ',', ' ') }} €
TOTAL AVEC TVA {{ $isTVA55 ? '5.5%' : '10% (LLI)' }}
Si annexes sans TVA {{ $isTVA55 ? '5.5%' : '10%' }}, utilise prix TTC • Si frais notaire sans TVA {{ $isTVA55 ? '5.5%' : '10%' }}, utilise frais standard
{{ number_format($totalAvecTVA, 2, ',', ' ') }} €
TOTAL AVEC TVA 10% (LLI)
Si annexes sans TVA 10%, utilise prix TTC • Si frais notaire sans TVA 10%, utilise frais standard
{{ number_format($totalAvecTVA10, 2, ',', ' ') }} €

Total des charges (non inclus) {{ number_format($totalCharges, 2, ',', ' ') }} €
@endif @if($lot->descriptions && $lot->descriptions->count() > 0)
Descriptions du lot
@foreach($lot->descriptions as $description) @php // $description->type est déjà un enum (casté), pas besoin de tryFrom() // Si c'est null ou non défini, on utilise la valeur brute de l'attribut $descType = $description->type instanceof \App\Enums\DescriptionLotType ? $description->type : \App\Enums\DescriptionLotType::tryFrom($description->attributes['type'] ?? null); @endphp @if($descType)
{{ $descType->label() }}

{{ $description->text }}

@endif @endforeach
@endif @if($lot->surfaces && $lot->surfaces->count() > 0)
Surfaces du lot
@foreach($lot->surfaces as $surface) @endforeach
Type Surface (m²)
{{ $surface->type->label() }} {{ number_format($surface->value, 2, ',', ' ') }} m²
@endif @if($lot->annexes && $lot->annexes->count() > 0)
Annexes {{ $lot->annexes->count() }} Total
@php // Grouper les annexes par type $groupedAnnexes = $lot->annexes->groupBy('type'); @endphp @foreach($groupedAnnexes as $annexeType => $annexesOfType)
{{ $annexesOfType->first()->type->label() }}
{{ $annexesOfType->count() }} {{ $annexesOfType->count() > 1 ? 'unités' : 'unité' }}
@foreach($annexesOfType as $index => $annexe)
{{ $annexesOfType->first()->type->label() }} #{{ $loop->iteration }}
@if($annexe->number)
Numéro : {{ $annexe->number }}
@endif @php $annexeSurface = $annexe->surfaces->first(); @endphp @if($annexeSurface)
Surface : {{ number_format($annexeSurface->value, 2, ',', ' ') }} m²
@endif @php try { $annexeTypeIsPriceable = $annexe->type && $annexe->type->priceable(); } catch (\Throwable $e) { $annexeTypeIsPriceable = false; } @endphp @if($annexeTypeIsPriceable && $annexe->prices && $annexe->prices->count() > 0)
Prix : @php $annexePrixTTC = $annexe->prices->where('type', 'prix_ttc')->first(); $annexePrixTVA = $annexe->prices->where('type', 'prix_tva_5_5')->first(); $annexePrixTVA10 = $annexe->prices->where('type', 'prix_tva_10')->first(); $autresPrix = $annexe->prices->whereNotIn('type', ['prix_ttc', 'prix_tva_5_5', 'prix_tva_10']); @endphp @if($annexePrixTTC)
{{ $annexePrixTTC->type_enum->label() }}
{{ number_format($annexePrixTTC->value, 2, ',', ' ') }} € @if($annexePrixTTC->read_only) (inclus dans le prix du bien) @endif
@endif @if($annexePrixTVA)
{{ $annexePrixTVA->type_enum->label() }}
{{ number_format($annexePrixTVA->value, 2, ',', ' ') }} € @if($annexePrixTVA->read_only) (inclus dans le prix du bien) @endif
@endif @if($annexePrixTVA10)
{{ $annexePrixTVA10->type_enum->label() }}
{{ number_format($annexePrixTVA10->value, 2, ',', ' ') }} € @if($annexePrixTVA10->read_only) (inclus dans le prix du bien) @endif
@endif @foreach($autresPrix as $price)
@if($price->type_enum) {{ $price->type_enum->label() }} @endif
{{ number_format($price->value, 2, ',', ' ') }} € @if($price->read_only) (inclus dans le prix du bien) @endif
@endforeach
@endif
@endforeach
@php // Calculer la surface totale pour ce type d'annexe $totalSurface = 0; foreach($annexesOfType as $annexe) { $surface = $annexe->surfaces->first(); if($surface) { $totalSurface += $surface->value; } } @endphp @if($totalSurface > 0)
Surface totale {{ number_format($totalSurface, 2, ',', ' ') }} m²
@endif
@endforeach
@endif @if($lot->fiscalites->count() > 0)
Fiscalités applicables
@foreach($lot->fiscalites as $fiscalite)
{{ $fiscalite->type->label() }}
{{-- Dispositif fiscal --}}
@endforeach
@endif
Options sur ce lot
@php $lotOptions = \App\Models\Option::where('product_id', $lot->id) ->where('application_id', $application->id) ->with(['client']) ->orderBy('created_at', 'asc') ->get(); @endphp @if($lotOptions->count() > 0) @else

Aucune option sur ce lot

@endif

Dates importantes

{{ $lot->created_at->format('d/m/Y à H:i') }}

{{ $lot->updated_at->format('d/m/Y à H:i') }}

@if($lot->documents->count() > 0)
Documents PDF
Glissez-déposez pour réorganiser
@endif
@endsection