@extends('layouts.app') @section('page_title','Savings & Goals') @section('content')
Current Savings
৳ {{number_format($totalSavings,2)}}
Available across savings categories
Total Added
৳ {{number_format($totalAdded,2)}}
All savings deposits
Total Withdrawn
৳ {{number_format($totalWithdrawn,2)}}
Money taken back from savings
Goals
{{$goals->count()}}
Track your savings targets
{{-- Goal setup and goal tracking use equal-width panels. --}}
@csrf

Set Savings Goal

Choose a savings category and set the amount you want to reach.

Goals

Progress is calculated from the live savings balance of each linked category.

{{$goals->count()}} goals
@forelse($goals as $g)
{{$g->name}}
Linked: {{$g->category?->name ?? '—'}} · {{$g->target_date?->format('d M Y') ?? 'No deadline'}}
{{$g->progress_percent}}% @if($g->progress_percent >= 100) @endif
৳ {{number_format((float)$g->current_amount,2)}} ৳ {{number_format((float)$g->target_amount,2)}}
@if($g->notes)
{{$g->notes}}
@endif
@csrf @method('DELETE')
@empty
No goals yet.
@endforelse
{{-- Savings withdrawal and category overview use equal-width panels. --}}
@csrf

Withdraw Savings

Choose the savings category, amount, receiving account and purpose.

Savings by Category

Each balance is deposits minus withdrawals.

{{$savingsCategories->count()}} categories
@forelse($savingsCategories as $category) @php($row=$savingsByCategory[$category->id]??['added'=>0,'withdrawn'=>0,'current'=>0]) @php($historyId='savings-history-'.$category->id) @php($categoryHistory=$savingsWithdrawals->where('category_id',$category->id)) @empty @endforelse @if($uncategorizedSavings > 0) @endif
CategoryAddedWithdrawnCurrent SavingsHistory
{{$category->name}}
৳ {{number_format($row['added'],2)}} ৳ {{number_format($row['withdrawn'],2)}} ৳ {{number_format($row['current'],2)}}
No savings categories yet. Add one from Categories.
Uncategorized Savings
Older savings without a category
——৳ {{number_format($uncategorizedSavings,2)}}—
@endsection @push('scripts') @endpush