@php $canLotsWrite = $canLotsWrite ?? auth()->user()->canAccessPartnerLotsWrite(); $canProgramsWrite = auth()->user()->canAccessPartnerProgramsWrite(); $priceableAnnexes = $program->annexes() ->with(['parentProduct.states', 'prices', 'surfaces', 'states']) ->get() ->filter(fn ($annexe) => $annexe->type && $annexe->type->priceable()) ->sortBy('id') ->values(); $annexeTypes = \App\Enums\ProductType::priceableAnnexeTypes(); @endphp
| {{ $annexe->type?->label() ?? 'Type inconnu' }} | {{ $annexe->number ?: '—' }} | @if($surface) {{ fmod((float) $surface->value, 1.0) === 0.0 ? number_format((float) $surface->value, 0, ',', ' ') : number_format((float) $surface->value, 2, ',', ' ') }} m² @else — @endif |
@if($parentLot)
Lot {{ $parentLot->number }}
@if($canProgramsWrite)
@if($canDetach)
@else
@endif
@endif
@else
@if($state === \App\Enums\ProductState::LIBRE && $canProgramsWrite)
@else
Non rattachée
@endif
@endif
|
{{ $ttcPrice ? number_format((float) $ttcPrice->value, 0, ',', ' ') . ' €' : '—' }} | {{ $state->label() }} | |
Aucune annexeCe programme ne contient pas encore d'annexe vendable. |
||||||