@extends('layouts.finance') @section('title', 'Saving Amount') @section('subtitle', 'Money set aside alongside salary payments') @section('content') @php $dateFilter = $dateFilter ?? ['active' => false, 'from' => null, 'to' => null, 'label' => null]; $dashboardRouteParams = ($dateFilter['active'] ?? false) ? ['from' => $dateFilter['from'], 'to' => $dateFilter['to']] : []; $entryCount = $savingAccounts->sum(fn ($account) => $account->entries->count()); @endphp
Back to Dashboard
{{-- Totals, one per currency: savings are held in the currency they were paid in. --}}
@forelse($totalsByCurrency as $currency => $total)
Total Saved ({{ $currency }})
{{ $metrics->money($total, $currency) }}
Across {{ $savingAccounts->where('currency', $currency)->count() }} account(s)
@empty
Total Saved
No savings recorded yet
@endforelse

Saving Accounts

One row per bank and account number. Saving into the same bank and last four digits tops up that row.

{{ $savingAccounts->count() }} account(s) · {{ $entryCount }} deposit(s)
@forelse($savingAccounts as $account) @empty @endforelse
Bank Account Currency Deposits Saved Last Saved
{{ $account->bank_name }} •••• {{ $account->last_four }} {{ $account->currency }} {{ $account->entries->count() }} {{ $metrics->money($account->balance, $account->currency) }} {{ optional($account->entries->first()?->entry_date)->format('d M Y') ?: '—' }}
Nothing saved yet. Add a saving amount on a salary debit to start one.
@if($entryCount > 0)

Deposits

@foreach($savingAccounts as $account) @foreach($account->entries as $entry) @endforeach @endforeach
Date Saving Account From Account Employee Amount
{{ $entry->entry_date?->format('d M Y') }} {{ $account->bank_name }} •••• {{ $account->last_four }} {{ $entry->bankAccount?->name ?: '—' }} {{ $entry->employee?->name ?: '—' }} {{ $metrics->money($entry->amount, $entry->currency) }}
@endif @endsection