@php $d = $breakdown['irs_data']; $components = $breakdown['components']; $suggested = $breakdown['suggested']; $method = $breakdown['method']; $fmt = fn($v) => $v !== null ? '$' . number_format($v) : '—'; $pct = fn($v) => $v !== null ? $v . '%' : '—'; $source = strtoupper((string) ($record->data_source ?? 'IRS')); $schedule = $source === 'CRA' ? 'Schedule 2' : 'Schedule F'; $form = $source === 'CRA' ? 'T3010' : 'Form 990'; $outside = $source === 'CRA' ? 'outside Canada' : 'outside the U.S.'; $confidence = $breakdown['confidence'] ?? null; $methodLabels = [ 'schedule_f_expenditures' => $schedule . ' Foreign Expenditures', 'schedule_f_assistance' => $schedule . ' Foreign Assistance', 'ccew_institutional_grants_proxy' => 'CCEW Institutional-Grants Proxy', 'ccew_foreign_no_grants' => 'CCEW Foreign Areas, No Grants Reported', 'foreign_no_amount' => 'Foreign Activity Flagged, No Amount', 'no_foreign_activity' => 'No Foreign Activity (R1 N/A)', 'not_applicable' => 'Not Applicable', ]; $methodColors = [ 'schedule_f_expenditures' => '#0369a1', 'schedule_f_assistance' => '#059669', 'ccew_institutional_grants_proxy' => '#7c3aed', 'ccew_foreign_no_grants' => '#9ca3af', 'foreign_no_amount' => '#d97706', 'no_foreign_activity' => '#6b7280', 'not_applicable' => '#9ca3af', ]; $methodLabel = $methodLabels[$method] ?? $method; $methodColor = $methodColors[$method] ?? '#6b7280'; $confColors = ['high' => '#15803d', 'medium' => '#d97706', 'low' => '#b91c1c']; $suggestedLabel = $suggested === null ? 'N/A' : $suggested; $suggestedBg = $suggested === null ? '#6b7280' : '#15803d'; $yoy = $d['yoy_change_pct']; $yoyColor = $yoy === null ? '#9ca3af' : ($yoy >= 0 ? '#059669' : '#dc2626'); $yoySign = $yoy !== null && $yoy >= 0 ? '+' : ''; @endphp
{{-- IRS Data Table --}}
Field Value Notes
Total Revenue (CY)
{{ $fmt($d['total_revenue']) }}
{{ $d['total_revenue_py'] ? 'PY: '.$fmt($d['total_revenue_py']) : '—' }} @if($yoy !== null) ({{ $yoySign }}{{ $yoy }}%) @endif
Program Expenses
{{ $fmt($d['program_expenses']) }}
{{ $pct($d['program_ratio_pct']) }} of expenses
Foreign Expenditures ({{ $schedule }} Part I)
{{ $fmt($d['foreign_expenditures']) }}
{{ $d['schedule_f_filed'] ? 'Primary outflow metric' : '—' }}
Foreign Assistance Total (Parts II+III)
{{ $fmt($d['foreign_assistance_total']) }}
Org: {{ $fmt($d['foreign_org_assistance']) }} | Indiv: {{ $fmt($d['foreign_individual_assistance']) }}
Foreign Outflow Used
{{ $fmt($d['foreign_outflow_used']) }}
{{ $d['foreign_activities'] ? 'Foreign activity reported' : 'No foreign activity flag' }}
Total Expenses
{{ $fmt($d['total_expenses']) }}
Fundraising Expenses
{{ $fmt($d['fundraising_expenses']) }}
{{ $pct($d['fundraising_ratio_pct']) }} of expenses
Mgmt & General Expenses
{{ $fmt($d['mgmt_expenses']) }}
Grants Paid
{{ $fmt($d['grants_paid']) }}
Salaries
{{ $fmt($d['salaries']) }}
{{-- Methodology callout --}}
Methodology
{{ $methodLabel }}

@if($method === 'schedule_f_expenditures') Foreign expenditures ÷ total revenue — AAA-faithful R1-A. Uses {{ $schedule }} Part I spending {{ $outside }} as the numerator. @elseif($method === 'schedule_f_assistance') Foreign assistance ÷ total revenue — {{ $schedule }} Part II + III foreign grants/assistance used as a fallback numerator when Part I is missing. @elseif($method === 'ccew_institutional_grants_proxy') Institutional grants ÷ total revenue — CCEW publishes no geographic spend breakdown. This proxy assumes all expenditure_grants_institution flows to overseas partners. Accurate for relay charities (Tearfund, Christian Aid); understates field-office charities. @elseif($method === 'ccew_foreign_no_grants') R1 wants foreign-output throughput; CCEW does not publish it for this filing. The charity declares foreign areas of operation, but:

Per AAA §(d) Transparency — "when transparency is deficient, an educated guess is made, with the benefit of the doubt tending to the negative side" — R1 defaults to 25/100 (low confidence). If a sibling registration publishes foreign-spend lines separately, that filing is the better source for the international R1. @elseif($method === 'foreign_no_amount') {{ $schedule }} filed, but no outflow amount reported. The {{ $form }} filer ticked the foreign-activity box but reported $0 across Part I (foreign expenditures) and Parts II/III (grants to foreign orgs and individuals). Without a foreign-output dollar amount, R1 has no numerator to divide by total revenue. Program-expense and fundraising-cost ratios are not used as substitutes — AAA §R1(a)(b) rejects them as misleading. Per AAA §(d), opacity tends negative → 25/100 (low confidence). @elseif($method === 'no_foreign_activity') Domestic-only filing. No {{ $schedule }} filed, no foreign countries listed, and the foreign-activity flag is unset. AAA scope is international poverty alleviation, so R1 (foreign-output throughput) does not apply to this charity at all. 25/100 is a placeholder; the composite renormalizes across R2–R4. @else Neutral 25/100 fallback applied. @endif

@foreach($components as $comp) @endforeach
Component Max Earned Calculation
{{ $comp['label'] }} {{ $comp['max'] }} {{ $comp['earned'] === null ? 'N/A' : $comp['earned'] }} {{ $comp['explanation'] }}
Suggested score: {{ $suggestedLabel }} @if($confidence) {{ strtoupper($confidence) }} confidence @endif