@php $imageSrc = null; if(!is_null($doc['document_logo'])){ $imagePath = public_path('images/sites/logo/'. $doc['document_logo']); $imageData = base64_encode(file_get_contents($imagePath)); $imageSrc = 'data:image/png;base64,' . $imageData; // Ajustez le type MIME si nécessaire } @endphp Matrice inventaire
@if(!is_null($imageSrc))
@endif

Inventaire

{!! nl2br($doc['document_header']) !!}
Type inventaire: Saisie des régularisations
Type d'inventaire: Cumuls de stocks à jour
Date:
@foreach ($cols as $k => $col) @endforeach @foreach ($products->toArray() as $i => $item) @php $price = isset($item['supplier_prices'][0]) ? (float)$item['supplier_prices'][0]['price'] : 0; $stock = isset($item['stock'][0]) ? (float)$item['stock'][0]['stock'] : 0; $reorderLevel = isset($item['locations'][0]) ? $item['locations'][0]['reorder_level'] : 0; $valeur = (float)$stock * (float)$price; // Définition des couleurs en inline style $textColor = '#15803d'; // Vert par défaut $borderColor = '#15803d'; $bgColor = '#bbf7d0'; if ($stock == 0) { $textColor = '#b91c1c'; // Rouge $borderColor = '#b91c1c'; $bgColor = '#fecaca'; } elseif ($stock > 0 && $stock <= $reorderLevel) { $textColor = '#b45309'; // Orange $borderColor = '#b45309'; $bgColor = '#fed7aa'; } @endphp @endforeach
{{$col['title']}}
{{$item['reference']}}

{{$item['title']}}

{!! implode(' - ', array_map(fn($cat) => "{$cat['title']}", $item['categories'])) !!}

{{$item['stock'][0]['stock']}}
{{$item['unitedetail']['title']}} {{number_format($price, 2, ",", " ")."Ar"}} {{number_format($valeur, 2, ",", " ")."Ar"}}