ultimatepos/Modules/ManagementTools/Resources/views/executive_cockpit/partials/drilldown_pdf.blade.php

64 lines
2.2 KiB
PHP

@foreach(($data['drilldown'] ?? []) as $tabKey => $section)
<h3>{{ $data['drilldown_labels'][$tabKey] ?? $tabKey }}</h3>
<table>
<thead>
<tr>
<th>@lang('managementtools::lang.metric')</th>
<th>@lang('managementtools::lang.actual')</th>
<th>@lang('managementtools::lang.vs_previous_period')</th>
</tr>
</thead>
<tbody>
@foreach(($section['kpis'] ?? []) as $kpi)
<tr>
<td>{{ $kpi['label'] }}</td>
<td>
@if(!empty($kpi['currency']))
{{ number_format((float) $kpi['value'], 2) }}
@else
{{ $kpi['value'] }}
@endif
</td>
<td>
@if(!empty($kpi['comparison']))
@if(($kpi['comparison']['direction'] ?? 'flat') === 'flat')
@lang('managementtools::lang.no_change')
@else
{{ ($kpi['comparison']['delta_pct'] ?? 0) > 0 ? '+' : '' }}{{ number_format((float) ($kpi['comparison']['delta_pct'] ?? 0), 1) }}%
@endif
@else
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
@if(!empty($section['top_items']))
<table>
<thead>
<tr>
<th>@lang('managementtools::lang.top_5_items')</th>
<th>@lang('managementtools::lang.amount')</th>
</tr>
</thead>
<tbody>
@foreach($section['top_items'] as $item)
<tr>
<td>{{ $item['label'] }}</td>
<td>
@if(!empty($item['currency']))
{{ number_format((float) ($item['value'] ?? 0), 2) }}
@else
{{ $item['value'] ?? '-' }}
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
@endif
@endforeach