@php $tz = config('app.display_timezone'); $f = $contents['figures']; $statusColor = ['draft' => 'amber', 'submitted' => 'sky', 'reviewed' => 'emerald']; $stats = [ ['label' => __('New opportunities'), 'value' => $f['opportunities_opened'], 'icon' => 'plus', 'tone' => 'bg-indigo-50 text-indigo-600'], ['label' => __('Outreach'), 'value' => $f['outreach'], 'icon' => 'paper-airplane', 'tone' => 'bg-sky-50 text-sky-600'], ['label' => __('Meetings'), 'value' => $f['meetings'], 'icon' => 'users', 'tone' => 'bg-violet-50 text-violet-600'], ['label' => __('Pitches'), 'value' => $f['pitches'], 'icon' => 'document-text', 'tone' => 'bg-fuchsia-50 text-fuchsia-600'], ['label' => __('Follow-ups done'), 'value' => $f['follow_ups_completed'], 'icon' => 'check-circle', 'tone' => 'bg-emerald-50 text-emerald-600'], ['label' => __('Overdue tasks'), 'value' => $f['tasks_overdue'], 'icon' => 'exclamation-triangle', 'tone' => 'bg-rose-50 text-rose-600'], ['label' => __('Qualified'), 'value' => $f['qualified'], 'icon' => 'flag', 'tone' => 'bg-cyan-50 text-cyan-600'], ['label' => __('Handovers accepted'), 'value' => $f['handovers_accepted'], 'icon' => 'arrow-path', 'tone' => 'bg-amber-50 text-amber-600'], ['label' => __('Won'), 'value' => $f['won'], 'icon' => 'trophy', 'tone' => 'bg-emerald-50 text-emerald-600'], ['label' => __('Lost'), 'value' => $f['lost'], 'icon' => 'exclamation-triangle', 'tone' => 'bg-slate-100 text-slate-600'], ]; $listMeta = [ 'opened' => __('New opportunities'), 'qualified' => __('Qualified for the first time'), 'won' => __('Won'), 'lost' => __('Lost'), ]; $num = fn ($v): string => rtrim(rtrim(number_format((float) $v, 1), '0'), '.'); @endphp
{{ __('Weekly Reports') }}
{{ __(\App\Models\Crm\WeeklyReport::STATUSES[$report->status] ?? $report->status) }} {{ __('PDF') }}
@if ($report->isSubmitted()) {{ __('Figures frozen when submitted on :date. They come from what was logged in the CRM that week.', ['date' => $report->submitted_at?->timezone($tz)->format('j M Y, H:i')]) }} @else {{ __('These figures are filled in from what was logged this week and keep updating until you submit. You only need to add blockers and next week\'s priorities.') }} @endif
{{-- The week in figures --}}
@foreach ($stats as $s)

{{ $s['label'] }}

{{ number_format($s['value']) }}

@endforeach

{{ __('Activity by channel') }}

@forelse ($contents['figures']['interactions'] as $type => $count)
{{ __($channels[$type] ?? ucfirst($type)) }}
{{ number_format($count) }}
@empty

{{ __('Nothing logged this week.') }}

@endforelse
{{ __('Proposals submitted') }}
{{ number_format($f['proposals_submitted']) }}
{{ __('Handovers sent') }}
{{ number_format($f['handovers_submitted']) }}
{{ __('Deferred') }}
{{ number_format($f['deferred']) }}

{{ __('Pipeline they own') }}

{{ $report->isSubmitted() ? __('As it stood at submission') : __('As it stands now') }}

{{ __('Open opportunities') }}
{{ number_format($contents['pipeline']['count']) }}
{{ __('Estimated value (base)') }}
{{ $contents['pipeline']['value_base'] === null ? __('Not estimated') : number_format($contents['pipeline']['value_base'], 2) }}
{{ __('Not estimated') }}
{{ number_format($contents['pipeline']['not_estimated']) }}
{{ __('Gone quiet') }}
{{ number_format($contents['pipeline']['stale']) }}

{{ __('Against weekly targets') }}

@if (empty($contents['targets']))

{{ __('No weekly targets are in force for this officer.') }}

@else
@foreach ($contents['targets'] as $t) @php($pct = in_array($t['metric'], $percentMeasures, true) ? '%' : '')
{{ __($t['label']) }}
{{ $t['actual'] === null ? __('Not available') : $num($t['actual']).$pct }} / {{ $num($t['target']).$pct }}
@endforeach
@endif

{{ __('Opportunities this week') }}

@foreach ($listMeta as $key => $label)

{{ $label }} ({{ count($contents['lists'][$key]) }})

    @forelse ($contents['lists'][$key] as $o)
  • {{ $o['title'] }} @if ($o['organisation']) · {{ $o['organisation'] }} @endif
  • @empty
  • {{ __('None') }}
  • @endforelse
@endforeach
{{-- The officer's words --}}

{{ __('Blockers and next week') }}

@if ($canEdit)
{{ __('Save draft') }} {{ __('Saving…') }} {{ __('Submit report') }} {{ __('Submitting…') }}
@else

{{ __('Blockers') }}

{{ $report->blockers ?: __('None reported') }}

{{ __('Next week\'s priorities') }}

{{ $report->priorities ?: __('Not written yet') }}

@endif
@if ($report->status === 'reviewed' || $canReview)

{{ __('Director review') }}

@if ($report->status === 'reviewed')

{{ __('Reviewed by :name on :date.', ['name' => $report->reviewer?->name ?? __('Not available'), 'date' => $report->reviewed_at?->timezone($tz)->format('j M Y')]) }}

@if ($report->review_note)

{{ $report->review_note }}

@endif @endif @if ($canReview && $report->status === 'submitted')
{{ __('Mark reviewed') }}
@endif
@endif