Informations du lot
Numéro
{{ $lot->number }}
@if($lot->gender)
Catégorie de logement
{{ $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)
Type
{{ $lotType->label() }}
@if($lotType->isPMR())
PMR
@endif
@endif
@if($lot->floor)
Niveau / Étage
{{ $lot->floor->shortLabel() }}
@endif
@if($lot->orientations && $lot->orientations->count() > 0)
Orientations
@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)
Tantième
{{ $lot->tantieme }}
@endif
@if($lot->surfaces && $lot->surfaces->count() > 0)
Surfaces
@foreach($lot->surfaces as $surface)
{{ $surface->type->label() }}
{{ number_format($surface->value, 2, ',', ' ') }} m²
@endforeach
@endif
État
{{ $lot->current_state->label() }}
Status
@if($lot->is_active)
Actif
@else
Inactif
@endif
Informations techniques
Nombre de prix
{{ $lot->prices?->count() ?? 0 }} prix
Nombre d'annexes
{{ $lot->annexes?->count() ?? 0 }} annexe(s)
@if(isset($formEditor) && $formEditor && $formEditor->fields->count() > 0)
@foreach($formEditor->fields as $field)
@php
$fieldValue = $field->data && isset($field->data->json['value']) ? $field->data->json['value'] : null;
@endphp
@if($fieldValue !== null && $fieldValue !== '')
{{ $field->label ?? $field->type->label() }}
@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
Type
Montant
@foreach($salePrices as $price)
@if($price->type_enum)
{{ $price->type_enum->label() }}
@else
Non défini
@endif
{{ number_format($price->value, 2, ',', ' ') }} €
@endforeach
@if($lot->getTotalTravauxReadOnly() > 0 && $lot->getPrixLotTTC() > 0)
Prix foncier
(Prix TTC - Travaux inclus)
{{ number_format($lot->getPrixFoncier(), 2, ',', ' ') }} €
@endif
@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)
Type
Montant
@foreach($immoPrices as $price)
@php
$priceTypeEnum = \App\Enums\PriceType::tryFrom($price->type);
@endphp
@if($priceTypeEnum)
{{ $priceTypeEnum->label() }}
@else
{{ $price->type }}
@endif
{{ number_format($price->value, 2, ',', ' ') }} €
@endforeach
@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
Type
Montant mensuel
@foreach($rentalPrices as $price)
@if($price->type_enum)
{{ $price->type_enum->label() }}
@else
Non défini
@endif
{{ number_format($price->value, 2, ',', ' ') }} €
/mois
@endforeach
@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
Type
Montant
@foreach($travauxPrices as $price)
@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, ',', ' ') }} €
@endforeach
@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
Type
Montant
@foreach($fraisPrices as $price)
@if($price->type_enum)
{{ $price->type_enum->label() }}
@else
Non défini
@endif
{{ number_format($price->value, 2, ',', ' ') }} €
@endforeach
@endif
@php
$chargePrices = $lot->prices->filter(function($price) {
return in_array($price->type, ['taxe_fonciere', 'charge_copropriete']);
});
@endphp
@if($chargePrices->count() > 0)
Charges
Type
Montant
@foreach($chargePrices as $price)
@if($price->type_enum)
{{ $price->type_enum->label() }}
@else
Non défini
@endif
{{ number_format($price->value, 2, ',', ' ') }} €
@endforeach
@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)
Prix du lot TTC
{{ number_format($prixLotTTC, 2, ',', ' ') }} €
@endif
@if($totalAnnexesTTC > 0)
Prix des annexes TTC
{{ number_format($totalAnnexesTTC, 2, ',', ' ') }} €
@endif
@if($prixLotTTC > 0 || $totalAnnexesTTC > 0)
Total lot + annexes TTC
{{ number_format($totalLotEtAnnexes, 2, ',', ' ') }} €
@endif
@if($totalTravaux > 0)
Total des travaux
+ {{ number_format($totalTravaux, 2, ',', ' ') }} €
@endif
@if($totalTravaux > 0 || $totalFrais > 0 || $totalCharges > 0)
@endif
@if($totalFrais > 0)
Total des frais
+ {{ number_format($totalFrais, 2, ',', ' ') }} €
@endif
@if($totalFraisAvecTVA > 0)
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, ',', ' ') }} €
@endif
@if($prixLotTVA10 > 0 && $totalFraisAvecTVA10 > 0)
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, ',', ' ') }} €
@endif
@if($totalFrais > 0)
TOTAL GÉNÉRAL (avec frais)
{{ number_format($totalGeneral, 2, ',', ' ') }} €
@endif
@if($prixLotTVA > 0)
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, ',', ' ') }} €
@endif
@if($prixLotTVA10 > 0)
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, ',', ' ') }} €
@endif
@if($totalCharges > 0)
Total des charges (non inclus)
{{ number_format($totalCharges, 2, ',', ' ') }} €
@endif
@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)
@endif
@endforeach
@endif
@if($lot->surfaces && $lot->surfaces->count() > 0)
Surfaces du lot
Type
Surface (m²)
@foreach($lot->surfaces as $surface)
{{ $surface->type->label() }}
{{ number_format($surface->value, 2, ',', ' ') }} m²
@endforeach
@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)
@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)
@foreach($lotOptions as $lotOption)
@endforeach
@else
Aucune option sur ce lot
@endif
Dates importantes
Créé le
{{ $lot->created_at->format('d/m/Y à H:i') }}
Dernière modification
{{ $lot->updated_at->format('d/m/Y à H:i') }}