@php $statusBadge = [ 'over' => ['label' => __('Over budget'), 'chip' => 'bg-rose-50 text-rose-700'], 'under' => ['label' => __('Under budget'), 'chip' => 'bg-emerald-50 text-emerald-700'], 'on_track' => ['label' => __('On track'), 'chip' => 'bg-sky-50 text-sky-700'], ]; $monthLabels = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; @endphp
{{-- Grid editor: category × month --}} @if ($editor) {{ __('Save amounts') }} @if (! $editor['has_categories'])
@else
@foreach ($monthLabels as $label) @endforeach @foreach ($editor['categories'] as $cat) @for ($m = 1; $m <= 12; $m++) @endfor @endforeach
{{ __('Category') }}{{ $label }}{{ __('Total') }}
{{ $cat['name'] }} @if ($cat['cost_type'] && $cat['cost_type'] !== 'none') {{ ucfirst($cat['cost_type']) }} @endif {{ number_format($cat['total'], 2) }}
{{ __('Total') }} {{ $baseCode }} {{ number_format($editor['grand_total'], 2) }}
@error('lines.*.*')

{{ __('Amounts must be zero or a positive number.') }}

@enderror

{{ __('Tip: zeroed rows are dropped on save. Use the copy button to fill a whole year from January.') }}

@endif {{-- Budget list --}} @else {{ __('Variance report') }} @if ($canManage) {{ __('New Budget') }} @endif
@if ($rows->isEmpty())
@if ($canManage) {{ __('New Budget') }} @endif
@else
@foreach ($rows as $row)

{{ $row['name'] }}

@if ($row['is_active']) {{ __('Active') }} @endif

{{ __('FY :year', ['year' => $row['fiscal_year']]) }} · {{ trans_choice('{1}:count category|[2,*]:count categories', $row['categories'], ['count' => $row['categories']]) }}

{{ __('Planned') }}

{{ $baseCode }} {{ number_format($row['planned'], 0) }}

{{ __('Actual') }}

{{ $baseCode }} {{ number_format($row['actual'], 0) }}

@if ($row['used_pct'] !== null)
{{ __('Used') }} {{ $row['used_pct'] }}%
@endif
@if ($canManage) @endif @if ($canDelete) @endif
@endforeach
@endif @endif
{{-- Create / Edit meta modal --}} {{ $editingId ? __('Edit Budget') : __('New Budget') }}
{{ __('Cancel') }} {{ __('Save') }}