{{-- Sezione pasto DomPDF --}} @php $titoloPasto = mb_strtoupper((string) ($pasto['label'] ?? 'Pasto')); $isContinua = !empty($pasto['continua']); if ($isContinua) { $titoloPasto .= ' (CONTINUA)'; } $totaliPasto = is_array($pasto['totali_pasto'] ?? null) ? $pasto['totali_pasto'] : []; $mostraMacro = !$isContinua && !($nascondiMacroKcal ?? false) && $totaliPasto !== []; $energiaKcal = (int) round((float) ($totaliPasto['energia_kcal'] ?? 0)); $proteineG = (int) round((float) ($totaliPasto['proteine_g'] ?? 0)); $carboidratiG = (int) round((float) ($totaliPasto['carboidrati_g'] ?? 0)); $lipidiG = (int) round((float) ($totaliPasto['lipidi_g'] ?? 0)); @endphp
{{ $titoloPasto }}
@if($mostraMacro)
{{ $energiaKcal }} kcal  ·  P {{ $proteineG }} g  ·  C {{ $carboidratiG }} g  ·  G {{ $lipidiG }} g
@endif @forelse($pasto['alimenti'] ?? [] as $alimento) @if(($alimento['tipo'] ?? 'alimento') === 'alternative_marker') @if(!empty($alimento['mostra_barra']) || !empty($alimento['sostituti']))
ALTERNATIVE{{ !empty($alimento['barra_continua']) ? ' (continua)' : '' }}
@endif @foreach($alimento['sostituti'] ?? [] as $sost) @include('reportpdf.partials.v3-dompdf.food-row', [ 'nome' => $sost['nome'] ?? 'Alimento', 'quantita_g' => $sost['quantita_g'] ?? 0, 'porzione' => $sost['porzione'] ?? null, 'alternativa' => true, ]) @endforeach @elseif(($alimento['tipo'] ?? 'alimento') === 'ricetta') @include('reportpdf.partials.v3-dompdf.food-row', [ 'nome' => $alimento['nome'] ?? 'Ricetta', 'quantita_g' => 0, 'porzione' => null, ]) @foreach($alimento['componenti'] ?? [] as $componente) @include('reportpdf.partials.v3-dompdf.food-row', [ 'nome' => $componente['nome'] ?? 'Alimento', 'quantita_g' => $componente['quantita_g'] ?? 0, 'porzione' => $componente['porzione'] ?? null, ]) @include('reportpdf.partials.v3-dompdf.alternatives', [ 'sostituti' => $componente['sostituti'] ?? [], ]) @endforeach @if(!empty($alimento['sostituti'] ?? [])) @foreach($alimento['sostituti'] as $sostRicetta) @include('reportpdf.partials.v3-dompdf.food-row', [ 'nome' => 'oppure ' . ($sostRicetta['nome'] ?? 'Ricetta'), 'quantita_g' => 0, 'porzione' => null, ]) @foreach($sostRicetta['componenti'] ?? [] as $compSost) @include('reportpdf.partials.v3-dompdf.food-row', [ 'nome' => $compSost['nome'] ?? 'Alimento', 'quantita_g' => $compSost['quantita_g'] ?? 0, 'porzione' => $compSost['porzione'] ?? null, 'alternativa' => true, ]) @endforeach @endforeach @endif @else @include('reportpdf.partials.v3-dompdf.food-row', [ 'nome' => $alimento['nome'] ?? 'Alimento', 'quantita_g' => $alimento['quantita_g'] ?? 0, 'porzione' => $alimento['porzione'] ?? null, ]) @include('reportpdf.partials.v3-dompdf.alternatives', [ 'sostituti' => $alimento['sostituti'] ?? [], ]) @endif @empty
Nessun alimento inserito.
@endforelse