@php /** * Report Centre report (CRM S10). The same run the screen previews: its * filters, currency basis and definitions are printed on every copy. */ use App\Services\Crm\Reports\ReportFormat; use App\Services\Crm\Reports\ReportResult; $accent = $setting?->primary_color ?: '#124a61'; $font = $setting?->font_family ? $setting->font_family.', Arial, sans-serif' : 'Arial, Helvetica, sans-serif'; $companyName = $setting?->company_name ?: config('app.name'); $base = $context->baseCode; @endphp {{ $report->title }}

{{ $report->title }}

{{ $report->description }}
{{ $companyName }}
{{ __('Generated :when by :who', ['when' => $generated_at, 'who' => $generated_by]) }}

{{ __('Filters') }}

@foreach ($filters as $label => $value) @endforeach
{{ $label }}{{ $value }}
{{ __('Currency basis') }}{{ $basis }}
@if ($result->kpis !== [])
@foreach ($result->kpis as $kpi)
{{ $kpi['label'] }}
{{ ReportFormat::cell($kpi['value'], $kpi['type'], $base, $kpi['null']) }}
@if ($kpi['sub'])
{{ $kpi['sub'] }}
@endif
@endforeach
@endif @foreach ($result->sections as $section)

{{ $section['title'] }}

@if ($section['note'])
{{ $section['note'] }}
@endif @php $bars = ReportResult::bars($section); @endphp @if (count($bars) > 1) @foreach ($bars as $bar) @endforeach
{{ $bar['label'] }}
{{ ReportFormat::cell($bar['value'], $section['columns'][$section['chart']['value']]['type'], $base) }}
@endif @foreach ($section['columns'] as $column) @endforeach @forelse ($section['rows'] as $row) @foreach ($section['columns'] as $key => $column) @endforeach @empty @endforelse @if ($section['totals'] && $section['rows'] !== []) @foreach ($section['columns'] as $key => $column) @endforeach @endif
{{ $column['label'] }}
{{ ReportFormat::cell($row[$key] ?? null, $column['type'], $base, $column['null']) }}
{{ __($section['empty']) }}
{{ array_key_exists($key, $section['totals']) ? ReportFormat::cell($section['totals'][$key], $column['type'], $base, $column['null']) : '' }}
@endforeach @foreach ($result->notes as $note)

{{ $note }}

@endforeach

{{ __('Definitions') }}

@foreach ($report->definitions as $term => $meaning) @endforeach
{{ $term }}{{ $meaning }}
{{ __('Currency basis') }}{{ $basis }}
{{ __('Unknown values') }}{{ __('Shown as Not estimated, Not available or Not applicable, never as zero.') }}