@php
$accent = $letterhead['color'];
$cell = function ($value) {
if (is_array($value)) {
return [e($value['text'] ?? ''), $value['class'] ?? ''];
}
return [e((string) $value), ''];
};
@endphp
@unless($pdf)
@if($letterhead['logo'])
@else
| {{ $letterhead['initials'] }} |
@endif
|
{{ $letterhead['name'] }}
@if($letterhead['address']){{ $letterhead['address'] }} @endif
{{ collect([$letterhead['phone'] ? 'Tel: ' . $letterhead['phone'] : null, $letterhead['email']])->filter()->implode(' · ') }}
@if($letterhead['tax_number']) TPIN: {{ $letterhead['tax_number'] }}@endif
|
{{ $doc->title }}
@if($doc->period){{ $doc->period }} @endif
@if($doc->subtitle){{ $doc->subtitle }} @endif
|
@if($doc->filters)
@foreach($doc->filters as $label => $value)
{{ $label }}: {{ is_array($value) ? implode(', ', $value) : $value }}
@endforeach
@endif
@if($doc->summary)
@foreach(array_chunk($doc->summary, $doc->orientation === 'landscape' ? 6 : 4) as $chunk)
@foreach($chunk as $stat)
|
{{ $stat['label'] }}
{{ $stat['value'] }}
@if($stat['note']){{ $stat['note'] }} @endif
|
@endforeach
@endforeach
@endif
@foreach($doc->sections as $section)
{{ $section['title'] }}
@if($section['type'] === 'details')
@foreach(array_chunk($section['pairs'], 2, true) as $pairRow)
@foreach($pairRow as $k => $v)
| {{ $k }} | {{ $v }} |
@endforeach
@endforeach
@else
@if(empty($section['rows']))
{{ $section['empty'] }}
@else
@foreach($section['columns'] as $column)
| {{ $column['label'] }} |
@endforeach
@foreach($section['rows'] as $row)
@foreach($row['cells'] as $i => $value)
@php [$text, $class] = $cell($value); $align = $section['columns'][$i]['align'] ?? 'left'; @endphp
| {!! $text !!} |
@endforeach
@endforeach
@if($section['totals'])
@foreach($section['totals'] as $i => $value)
@php [$text, $class] = $cell($value); $align = $section['columns'][$i]['align'] ?? 'left'; @endphp
| {!! $text !!} |
@endforeach
@endif
@endif
@if($section['note'])
{{ $section['note'] }}
@endif
@endif
@endforeach
@foreach($doc->notes as $note)
{{ $note }}
@endforeach
@unless($pdf)
@endunless