@extends('layouts.base') @section('content') @section('breadcrumb') @endsection @if(session('status')) @endif @php $activeTab = session('open_tab') ?: 'informations-generales'; $optionStatesCount = $option->states()->count(); @endphp
#{{ $option->id }}

Option #{{ $option->id }}

@if($option->state) {{ $option->state->label() }} @endif @if($option->code) Code: {{ $option->code }} @endif @if($option->getRang()) Rang {{ $option->getRang() }} @endif Créée le {{ $option->created_at->format('d/m/Y à H:i') }} @php $otherOptions = $option->getOtherOptionsForSameProduct(); @endphp @if($otherOptions->count() > 0) Autre(s) option(s) : @foreach($otherOptions as $otherOption) @if($otherOption->getRang()) Rang {{ $otherOption->getRang() }} - @endif {{ $otherOption->client?->fullName() ?? 'Client inconnu' }} @endforeach @endif
Relations
@if($option->product) @if($option->product->program)
{{ $option->product->name }}
{{ $option->product->program->name }}
{{ $option->product->current_state->label() }}
@else
{{ $option->product->name }}
Aucun programme associé
{{ $option->product->current_state->label() }}
@endif @else

Aucun lot associé

@endif
@if($option->client)
{{ $option->client->fullName() }}
{{ $option->client->email }}
@else

Aucun client associé

@endif
@if($option->user)
{{ $option->user->fullName() }}
{{ $option->user->email }}
@else

Aucun commercialisateur associé

@endif
@if($option->saleParameter)
Durée option {{ $option->saleParameter->option_duration_day }} jour(s)
Rang {{ $option->saleParameter->option_rang }}
@else

Aucun paramètre de vente

@endif
@if($option->date_end)

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

@else

Non définie

@endif
Prix de l'option
@if($option->prices && $option->prices->count() > 0)
@foreach($option->prices as $price) @endforeach
Type Montant Statut
@if($price->type_enum) {{ $price->type_enum->label() }} @else {{ $price->type }} @endif {{ number_format($price->value, 2, ',', ' ') }} € @if($price->read_only) Lecture seule @endif @if(!$price->is_active) Inactif @endif
@else
Aucun prix associé à cette option
@endif
@if(auth()->user()->isRole('ROLE_SUPPORT'))
Données enregistrées (Snapshot JSON)
@if($option->datas->count() > 0) @foreach($option->datas as $data)
Data #{{ $data->id }} {{ $data->created_at->format('d/m/Y H:i') }}
{{ json_encode($data->json, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) }}
@endforeach @else
Aucune donnée enregistrée
@endif
@endif
@php $optionStates = $option->states()->orderBy('created_at', 'desc')->orderBy('id', 'desc')->get(); @endphp @if($optionStates->count() > 0)
@foreach($optionStates as $state) @endforeach
Date Statut
{{ $state->created_at->format('d/m/Y H:i:s') }} @php $stateType = $state->getAttributes()['type'] ?? null; if ($stateType instanceof \BackedEnum) { $stateType = $stateType->value; } if ($stateType === null) { $rawType = $state->getRawOriginal('type') ?? null; if ($rawType) { $stateType = $rawType; } else { $castedType = $state->type; if ($castedType instanceof \BackedEnum) { $stateType = $castedType->value; } else { $stateType = $castedType; } } } $optionState = $stateType ? \App\Enums\OptionState::tryFrom($stateType) : null; if (!$optionState) { $optionState = \App\Enums\OptionState::NON_DEFINI; } @endphp {{ $optionState->label() }}
@else

Aucun historique disponible

@endif
@endsection