@use('App\Support\CharityPresenter') @props(['charity', 'detailUrl']) @php // ── The 4R build-up ────────────────────────────────────────────────────── // Point maxima come straight from the ARK AID methodology (aaa-compassion.md): // R1 Revenue 50, R2 Religious 20, R3 Recipient 15, R4 Results 15. $pillars = [ ['label' => 'R1 Revenue', 'note' => 'Throughput along the charity chain', 'score' => $charity->score_revenue, 'max' => 50], ['label' => 'R2 Religious', 'note' => 'Identity and integrity', 'score' => $charity->score_religious, 'max' => 20], ['label' => 'R3 Recipient', 'note' => 'Poverty level of beneficiaries', 'score' => $charity->score_recipient, 'max' => 15], ['label' => 'R4 Results', 'note' => 'Professionalism, focus, spread', 'score' => $charity->score_results, 'max' => 15], ]; $missingPillars = collect($pillars)->whereNull('score')->count(); // ── Reach (R3/R4 context) ──────────────────────────────────────────────── $countries = (array) ($charity->foreign_countries ?? []); // Overseas spend and total expenditure come from different schedules // (Schedule F vs Part IX) and are not always on the same basis — some // filings report more abroad than they report spending in total. Showing // that as a percentage would invent a number; report the amounts instead. $foreignShare = ($charity->total_expenses > 0 && $charity->foreign_expenditures !== null) ? ($charity->foreign_expenditures / $charity->total_expenses) * 100 : null; $foreignShareUsable = $foreignShare !== null && $foreignShare <= 100; // ── Indicators ─────────────────────────────────────────────────────────── // Deliberately not a program/fundraising/admin split: ARK AID rejects cost // ratios as a metric ("fundamentally unfounded and often purposefully // misleading"), and prefers average staff pay over CEO pay. $ratio = ($charity->total_revenue && $charity->total_assets) ? $charity->total_assets / $charity->total_revenue : null; $avgComp = CharityPresenter::averageCompensation($charity->salaries, $charity->employees); // Keyed so each label can be an editable zone; the key is what the // customizer stores against, the label is only the default wording. $policies = [ 'audited' => ['label' => 'Audited accounts', 'met' => (bool) $charity->audited], 'conflict' => ['label' => 'Conflict-of-interest', 'met' => (bool) $charity->conflict_policy], 'whistleblower' => ['label' => 'Whistleblower', 'met' => (bool) $charity->whistleblower_policy], 'retention' => ['label' => 'Document retention', 'met' => (bool) $charity->doc_retention_policy], ]; $policiesMet = count(array_filter($policies, fn ($p) => $p['met'])); $boardIndep = ($charity->voting_members > 0 && $charity->independent_members !== null) ? ($charity->independent_members / $charity->voting_members) * 100 : null; @endphp
{{-- 1 · How the appraisal is built --}}

How this appraisal is built

@foreach ($pillars as $p) @php $has = $p['score'] !== null; $earned = $has ? ($p['score'] / 100) * $p['max'] : null; @endphp
{{ $p['label'] }} {{ $p['note'] }}
@if($has) @endif
@if($has) {{ number_format($earned, 1) }}/{{ $p['max'] }} @else no data @endif
@endforeach

Weighted total {{ $charity->score_composite !== null ? round($charity->score_composite) : '—' }}/100 @if($missingPillars > 0) · remaining metrics re-weighted to cover {{ $missingPillars }} without data @endif

{{-- 2 · Where the aid goes --}}

Where the aid goes

Countries reached
{{ count($countries) ?: '—' }}
Offices abroad
{{ $charity->foreign_offices ?? '—' }}
Staff abroad
{{ $charity->foreign_employees !== null ? number_format($charity->foreign_employees) : '—' }}
Programmes reported
{{ $charity->program_count ?: '—' }}
@if($foreignShareUsable)
Spent abroad {{ number_format($foreignShare, 0) }}%

{{ CharityPresenter::fmt($charity->foreign_expenditures) }} of {{ CharityPresenter::fmt($charity->total_expenses) }} total expenditure

@elseif($foreignShare !== null)
Spent abroad {{ CharityPresenter::fmt($charity->foreign_expenditures) }}

More than the {{ CharityPresenter::fmt($charity->total_expenses) }} total expenditure reported for {{ $charity->tax_year }} — the two figures come from different schedules and are not on the same basis.

@else

No overseas expenditure reported for {{ $charity->tax_year }}.

@endif
{{-- 3 · Indicators, explicitly not metrics --}}

Indicators & transparency

Asset ratio
{{ $ratio !== null ? number_format($ratio, 2) . '×' : '—' }}
Average staff pay
{{ $avgComp !== null ? CharityPresenter::fmt($avgComp) : '—' }}
Board independence
{{ $boardIndep !== null ? number_format($boardIndep, 0) . '%' : '—' }}
Filing
{{ $charity->data_source }} · {{ $charity->tax_year }}
@foreach ($policies as $policyKey => $policy) {{ $policy['label'] }} @endforeach

{{ $policiesMet }} of {{ count($policies) }} governance signals present. Asset ratio and pay are red-flag indicators, not scored metrics.

Full appraisal for {{ $charity->name }} →