@php $isWaste = $latest->type_consommable === 'dechet_toner'; // Inverser les couleurs pour le waste toner (plein = critique) if ($isWaste) { $_pctClass = $latest->pourcentage > 80 ? 'bg-danger' : ($latest->pourcentage > 50 ? 'bg-warning text-dark' : 'bg-success'); } else { $_pctClass = $latest->pourcentage < 20 ? 'bg-danger' : ($latest->pourcentage < 50 ? 'bg-warning text-dark' : 'bg-success'); } @endphp
@if($isPrinthead) @endif @php $_desc = $latest->description; if ($isWaste) { $_desc = 'Bac de récupération'; } elseif (in_array($latest->type_consommable, ['toner', 'encre'], true)) { $_four = \App\Services\SnmpNameMapper::findFourniture($materiel ?? null, $latest); $_desc = $_four ? $_four->nom . ' (' . $_four->reference . ')' : \App\Services\SnmpNameMapper::translate($latest->description); } else { $_desc = \App\Services\SnmpNameMapper::translate($latest->description); } @endphp {{ $_desc ?: ($latest->type_consommable ? $latest->type_consommable : '') }} @if($latest->pourcentage !== null) @if($isPrinthead) {{ $latest->pourcentage }}% @else {{ $latest->pourcentage }}% @endif @endif @if(!$latest->description && !$latest->type_consommable && ($latest->niveau_actuel === null || $latest->niveau_actuel < 0)) (données indisponibles) @endif @if($isPrinthead) Tête d'impression @elseif($latest->type_consommable === 'compteur') Compteur @else Slot {{ $index }}@if($latest->type_consommable) · {{ $latest->type_consommable }}@endif @endif
@if($latest->pourcentage !== null)
{{ $latest->pourcentage }}%
@elseif($latest->type_consommable === 'compteur' && $latest->niveau_actuel !== null && $latest->niveau_actuel >= 0)

{{ number_format($latest->niveau_actuel, 0, ',', ' ') }} @if($latest->unite) {{ $latest->unite }} @endif (depuis la mise en service)

@elseif($latest->niveau_actuel !== null && $latest->niveau_actuel >= 0)

Niveau : {{ $latest->niveau_actuel }} @if($latest->unite) {{ $latest->unite }} @endif @if($latest->niveau_max) / {{ $latest->niveau_max }} @endif

@else

Niveau non disponible

@endif @if($isPrinthead && $latest->donnees)
Compteurs par canal :
@foreach($latest->donnees as $canal => $count) @endforeach @foreach($latest->donnees as $canal => $count) @endforeach
{{ str_replace('canal_', 'CH', $canal) }}
{{ number_format($count, 0, ',', ' ') }}
@endif Dernier relevé : {{ $latest->releve_at?->format('d/m/Y H:i:s') ?: '-' }} @if($entries->count() > 1)
Historique ({{ $entries->count() }} relevés)
@foreach($entries as $e) @endforeach
Date Niveau %
{{ $e->releve_at?->format('d/m/Y H:i') }} {{ $e->niveau_actuel ?? '-' }} @if($e->unite) {{ $e->unite }} @endif {{ $e->pourcentage !== null ? $e->pourcentage . '%' : '-' }}
@endif