@extends('layouts.app') @section('title', 'Budgeting - GrowCash') @section('content')

Budget Management

Control your spending with smart budgets

@php $currentPeriode = request('periode', 'semua'); @endphp
@foreach([ ['semua', 'All'], ['mingguan', 'Weekly'], ['bulanan', 'Monthly'], ['tahunan', 'Yearly'] ] as [$value, $label]) {{ $label }} @endforeach
@forelse($budgets as $budget) @php $spent = $budget->transaksis->sum('nominal'); $progress = $budget->nominal_budget > 0 ? min(100, ($spent / $budget->nominal_budget) * 100) : 0; $remaining = max(0, $budget->nominal_budget - $spent); $isOverBudget = $spent > $budget->nominal_budget; @endphp
{{ substr($budget->nama_budget, 0, 1) }}

{{ $budget->nama_budget }}

{{ $budget->periode }}
@csrf @method('DELETE')

Spent

Rp {{ number_format($spent, 0, ',', '.') }}

Budget

Rp {{ number_format($budget->nominal_budget, 0, ',', '.') }}

{{ number_format($progress, 1) }}% Remaining: Rp {{ number_format($remaining, 0, ',', '.') }}
@if($isOverBudget)
Over budget!
@endif
@empty

No budgets yet

Create your first budget to start managing your finances better

@endforelse
@include('budgeting.modal-create') @include('budgeting.modal-edit') @endsection