@if ($canManage) {{ __('Income sources') }} {{ __('Record income') }} @endif {{-- KPIs --}}
{{-- Filters --}}
@if ($incomes->isEmpty()) @if ($canManage) {{ __('Record income') }} @endif @else
@foreach ($incomes as $income) @php $dedTotal = $income->deductions->sum('amount'); @endphp @endforeach
{{ __('Date') }} {{ __('Member') }} {{ __('Source / type') }} {{ __('Gross') }} {{ __('Deductions') }} {{ __('Net') }}
{{ $income->received_on?->format('j M Y') }} {{ $income->member->name ?? '—' }}

{{ $income->source->name ?? ucfirst(str_replace('_', ' ', $income->type)) }}

@if ($income->deductions->isNotEmpty())

{{ $income->deductions->map(fn ($d) => ($d->label ?: ucfirst(str_replace('_', ' ', $d->type))))->join(', ') }}

@endif
{{ $income->currency_code }} {{ number_format($income->gross_amount, 2) }} {{ $dedTotal > 0 ? '−'.number_format($dedTotal, 2) : '—' }} {{ $income->currency_code }} {{ number_format($income->net_amount, 2) }} @if ($canManage)
@endif
{{ $incomes->links() }}
@endif
{{-- Income modal --}} {{ $editingId ? __('Edit income') : __('Record income') }}

{{ __('Pick a saved salary to prefill and auto-deduct linked loans.') }}

{{-- Deduction lines --}}

{{ __('Deductions') }}

@if (empty($deductions))

{{ __('Add medical aid, NSSA, PAYE, pension… Loan repayments are added automatically when the salary is linked to a loan.') }}

@else
@foreach ($deductions as $index => $deduction)
@endforeach
@endif
{{ __('Net (before linked loan repayments)') }} {{ $currency_code }} {{ number_format($this->netPreview(), 2) }}
{{ __('Cancel') }} {{ __('Save income') }}
{{-- Income sources modal --}} {{ __('Income sources') }}
{{ $editingSourceId ? __('Update source') : __('Add source') }}
@if ($allSources->isNotEmpty())
@foreach ($allSources as $source) @endforeach

{{ $source->name }}

{{ $source->member->name ?? '' }} · {{ ucfirst($source->frequency) }}

{{ $source->currency_code }} {{ number_format($source->default_gross, 2) }}
@endif
{{ __('Done') }}