@extends('layouts.app') @section('content') @php use App\Enums\OptionState; use App\Enums\PriceType; use App\Enums\PriceTypeLoyer; use App\Enums\PriceTypeTravaux; use App\Enums\ProductType; use App\Enums\SurfaceType; use App\Enums\Fiscalite as FiscaliteEnum; use App\Helpers\CdnHelper; @endphp

Mes options

Gérez vos options en cours ici : renouvelez, confirmez ou annulez vos options


@if($options && $options->count() > 0)
@foreach($options as $option) @php $lot = $option->product; $program = $lot ? $lot->program : null; $client = $option->client; $state = $option->state; // Déterminer le libellé selon l'état $libelle_html = ''; $expiree = false; if ($state === OptionState::ACCEPTED || $state === OptionState::VALIDATED || $state === OptionState::CREATED) { if ($option->date_end && $option->date_end->isPast()) { $libelle_html = 'Expirée le ' . date_fr_hour_without_seconds($option->date_end, true); $expiree = true; } else { $libelle_html = 'Expire le ' . date_fr_hour_without_seconds($option->date_end, true); } } elseif ($state === OptionState::REJECTED) { $libelle_html = 'Refusée le ' . date_fr_hour_without_seconds($option->updated_at, true); } elseif ($state === OptionState::CONFIRMED) { $libelle_html = 'Confirmée le ' . date_fr_hour_without_seconds($option->updated_at, true); } elseif ($state === OptionState::CANCELED) { $libelle_html = 'Annulée le ' . date_fr_hour_without_seconds($option->updated_at, true); } // Récupérer les prix depuis l'option (copiés lors de la création) $lotPrices = $option->prices; // Récupérer les surfaces depuis le lot $lotSurfaces = $lot ? $lot->surfaces : collect(); $surfaceHabitable = $lotSurfaces->where('type', SurfaceType::HABITABLE->value)->first()?->value ?? 0; @endphp @if($lot && $program) @endif @endforeach
@if($expiree)
Expirée
@else
{{ $state->label() }}
@endif
{{ ucwords(mb_strtolower($program->name)) }}

Lot n°{{ $lot->number ?? '-' }} | {{ ucwords(mb_strtolower($program->city ?? '')) }}

Option {{ formatage_prenom_nom($client->firstname ?? '', $client->lastname ?? '') }}

{{ $libelle_html }} Posée le {{ date_fr_hour_without_seconds($option->created_at, true) }}

@if($state === OptionState::ACCEPTED) @else @endif
@if($expiree)
Expirée
@else
{{ $state->label() }}
@endif
{{ ucwords(mb_strtolower($program->name)) }}

Lot n°{{ $lot->number ?? '-' }} | {{ ucwords(mb_strtolower($program->city ?? '')) }}

Option {{ formatage_prenom_nom($client->firstname ?? '', $client->lastname ?? '') }}

{{ $libelle_html }}
Posée le {{ date_fr_hour_without_seconds($option->created_at, true) }}

@if($state === OptionState::ACCEPTED) @else @endif
@else

Vous n'avez encore aucune option

Consultez les programmes et choisissez un lot pour poser votre première option

Consultez les programmes
@endif
@push('scripts') @endpush @endsection