@php $d = $breakdown['irs_data']; $components = $breakdown['components']; $suggested = $breakdown['suggested']; $method = $breakdown['method']; $needScore = $breakdown['need_score']; $countryPts = $breakdown['country_pts']; $directPts = $breakdown['direct_pts']; $fmt = fn($v) => $v !== null ? '$' . number_format($v) : '—'; $pct = fn($v) => $v !== null ? $v . '%' : '—'; $badge = fn($bool, $yes='Yes', $no='No') => '' .($bool ? $yes : $no).''; $source = strtoupper((string) ($record->data_source ?? 'IRS')); $schedule = $source === 'CRA' ? 'Schedule 2' : 'Schedule F'; $confidence = $breakdown['confidence'] ?? null; $methodLabels = [ 'regions_recipient_count' => $schedule . ' Regions (RecipientCnt weighted)', 'regions_amount' => $schedule . ' Regions (amount weighted)', 'country_codes' => 'Country Codes (equal weight)', 'ccew_equal_weight_country' => 'CCEW Areas of Operation (equal weight)', 'foreign_no_geography' => 'Foreign Activity, No Geography', 'domestic_only' => 'Domestic Only (out of AAA scope)', 'not_applicable' => 'Not Applicable', ]; $methodColors = [ 'regions_recipient_count' => '#065f46', 'regions_amount' => '#0369a1', 'country_codes' => '#059669', 'ccew_equal_weight_country' => '#7c3aed', 'foreign_no_geography' => '#d97706', 'domestic_only' => '#9ca3af', 'not_applicable' => '#9ca3af', ]; $methodLabel = $methodLabels[$method] ?? $method; $methodColor = $methodColors[$method] ?? '#6b7280'; $confColors = ['high' => '#15803d', 'medium' => '#d97706', 'low' => '#b91c1c']; $hasScheduleF = $d['schedule_f_filed']; $countries = $d['foreign_countries'] ?? []; $countryDetails = $d['country_details'] ?? []; $regionDetails = $d['region_details'] ?? []; $grantRegions = $d['grant_regions'] ?? []; $indivRegions = $d['indiv_regions'] ?? []; @endphp
| Field | Value |
|---|---|
Grants Paid |
{{ $fmt($d['grants_paid']) }} |
Total Expenses |
{{ $fmt($d['total_expenses']) }} |
Grant Ratio |
{{ $pct($d['grant_ratio_pct']) }} |
Foreign Expenditures ({{ $schedule }}) |
{{ $fmt($d['foreign_expenditures']) }} |
| FIPS | Median Income | Need Score |
|---|---|---|
| {{ $ctry['code'] }} | {{ $fmt($ctry['median_income']) }} | {{ $ctry['need_score'] }} |
| Region | Recipients | Amount | Median Income | Need Score |
|---|---|---|---|---|
| {{ $reg['region'] }} | {{ !empty($reg['recipients']) ? number_format($reg['recipients']) : '—' }} | {{ $reg['amount'] > 0 ? $fmt($reg['amount']) : '—' }} | {{ $fmt($reg['median_income']) }} | {{ $reg['need_score'] }} |
@if($method === 'domestic_only')
Domestic-only charity — out of AAA international-poverty scope. Neutral 25/100 fallback (low confidence).
@elseif($method === 'foreign_no_geography')
Foreign activity flagged but no countries listed. Neutral 25/100 fallback (low confidence).
@else
Country need score formula:
min(100, 50000 ÷ median_income)
→ Weighted average = {{ $needScore }}
→ × 0.70 = {{ $countryPts }} pts
@if(($d['activity_modifier'] ?? 0) !== 0)
+ activity modifier {{ $d['activity_modifier'] > 0 ? '+' : '' }}{{ $d['activity_modifier'] }}
@endif
@endif
| Component | Max | Earned | Calculation |
|---|---|---|---|
| {{ $comp['label'] }} | {{ $comp['max'] }} | {{ $comp['earned'] === null ? 'N/A' : $comp['earned'] }} | {{ $comp['explanation'] }} |