@extends('savings.base') @section('action-content')

Savings Statement

@if(isset($transactions))
@csrf
@php $bal = 0; @endphp @foreach($transactions as $t) @php $bal += ($t->type == 'credit') ? $t->amount : -$t->amount; @endphp @endforeach
Date Type Amount Balance
{{ $t->created_at->format('d M Y') }} {{ strtoupper($t->type) }} {{ number_format($t->amount,2) }} {{ number_format($bal,2) }}
@endif
@endsection