@extends($master) @section('title', 'Manage CashBook') @section('body')
@if($startDate ?? 0)

Cost For The Date of ({{ \Carbon\Carbon::parse($startDate)->format('d-M-Y') }} --> {{ \Carbon\Carbon::parse($endDate)->format('d-M-Y') }})

@elseif($month ?? 0)

Cost For The Date of ({{\Carbon\Carbon::parse($month)->format('d-M-Y')}})

@else

Cost For The Date of ({{\Carbon\Carbon::parse($today)->format('d-M-Y')}})

@endif
@php // Initialize the starting balance (you can fetch this from the database or set a default value) $balance = 0; @endphp @foreach($costs as $cost) @if($cost->cr > 0) @php // Update the running balance based on the cashBook 'cr' $balance += $cost->cr; @endphp @endif @endforeach
SL No Date Detail Cost Balance
{{ $loop->iteration }} {{ \Carbon\Carbon::parse($cost->updated_at)->format('d-M-Y (H:i:s)') ?? " " }} {{ $cost->detail }} {{ number_format($cost->cr, 0) }} {{ number_format($balance, 0) }}
@endsection