@php
/**
* Weekly officer report (CRM S8). Same figures as the on-screen report:
* frozen at submission, or live for a draft.
*/
$accent = $setting?->primary_color ?: '#124a61';
$font = $setting?->font_family ? $setting->font_family.', Arial, sans-serif' : 'Arial, Helvetica, sans-serif';
$companyName = $setting?->company_name ?: $report->team?->name;
$f = $contents['figures'];
$num = fn ($v): string => rtrim(rtrim(number_format((float) $v, 1), '0'), '.');
$rows = [
__('New opportunities') => $f['opportunities_opened'],
__('Outreach activities') => $f['outreach'],
__('Meetings') => $f['meetings'],
__('Pitches (presentations and proposals)') => $f['pitches'],
__('Follow-ups completed') => $f['follow_ups_completed'],
__('Tasks overdue') => $f['tasks_overdue'],
__('Qualified for the first time') => $f['qualified'],
__('Handovers sent') => $f['handovers_submitted'],
__('Handovers accepted') => $f['handovers_accepted'],
__('Won') => $f['won'],
__('Lost') => $f['lost'],
__('Deferred') => $f['deferred'],
];
$lists = [
'opened' => __('New opportunities'),
'qualified' => __('Qualified for the first time'),
'won' => __('Won'),
'lost' => __('Lost'),
];
@endphp
{{ __('Weekly report') }}
{{ __('Weekly report') }}: {{ $report->user?->name }}
{{ $report->week_starting->format('j M Y') }} {{ __('to') }} {{ $weekEnd->format('j M Y') }}
|
{{ $companyName }}
{{ __(\App\Models\Crm\WeeklyReport::STATUSES[$report->status] ?? $report->status) }}
@if ($report->submitted_at)
ยท {{ __('submitted :date', ['date' => $report->submitted_at->timezone(config('app.display_timezone'))->format('j M Y H:i')]) }}
@endif
|
{{ __('The week in figures') }}
@foreach ($rows as $label => $value)
| {{ $label }} | {{ number_format($value) }} |
@endforeach
{{ __('Pipeline they own') }}
| {{ __('Open opportunities') }} | {{ number_format($contents['pipeline']['count']) }} |
| {{ __('Estimated value (base currency)') }} | {{ $contents['pipeline']['value_base'] === null ? __('Not estimated') : number_format($contents['pipeline']['value_base'], 2) }} |
| {{ __('Opportunities with no estimate') }} | {{ number_format($contents['pipeline']['not_estimated']) }} |
| {{ __('Gone quiet') }} | {{ number_format($contents['pipeline']['stale']) }} |
@if (! empty($contents['targets']))
{{ __('Against weekly targets') }}
| {{ __('Measure') }} | {{ __('Actual') }} | {{ __('Target') }} |
@foreach ($contents['targets'] as $t)
| {{ __($t['label']) }} |
{{ $t['actual'] === null ? __('Not available') : $num($t['actual']) }} |
{{ $num($t['target']) }} |
@endforeach
@endif
{{ __('Opportunities this week') }}
@foreach ($lists as $key => $label)
| {{ $label }} |
@forelse ($contents['lists'][$key] as $o)
{{ $o['title'] }}@if ($o['organisation']) ({{ $o['organisation'] }})@endif{{ $loop->last ? '' : ';' }}
@empty
{{ __('None') }}
@endforelse
|
@endforeach
{{ __('Blockers') }}
{{ $report->blockers ?: __('None reported') }}
{{ __('Next week\'s priorities') }}
{{ $report->priorities ?: __('Not written yet') }}
@if ($report->status === 'reviewed')
{{ __('Director review') }}
{{ __('Reviewed by :name on :date.', ['name' => $report->reviewer?->name, 'date' => $report->reviewed_at?->timezone(config('app.display_timezone'))->format('j M Y')]) }}@if ($report->review_note)
{{ $report->review_note }}@endif
@endif
{{ __('Figures are read from what was logged in the CRM, Monday to Sunday in :tz. Opportunity figures count opportunities the officer owns; activity figures count what the officer did. Money is in the base currency at the rate frozen on each opportunity. Generated :date.', ['tz' => config('app.display_timezone'), 'date' => $generatedAt->format('j M Y H:i')]) }}