@extends('layouts.app') @section('title','Expense Ledger') @section('breadcrumb') @endsection @section('content')
{{ $head->name }}
{{-- PAYMENT METHOD GROUPS --}} @php $grandTotal = 0; @endphp @foreach($transactions as $method => $rows)
{{ ucfirst($method) }} Payments
@php $groupTotal = 0; @endphp @foreach($rows as $t) @php $groupTotal += $t->transaction_amount; @endphp @endforeach {{-- GROUP TOTAL --}} @php $grandTotal += $groupTotal; @endphp
Date Narration Amount
{{ \Carbon\Carbon::parse($t->transaction_date)->format('d M Y') }} {{ $t->transaction_details ?? '-' }} {{ number_format($t->transaction_amount, 2) }}
Total {{ number_format($groupTotal, 2) }}
@endforeach
Grand Total ₹{{ number_format($grandTotal, 2) }}
@endsection