@extends('admin.admin_dashboard') @section('admin')

@php $totalDebit = 0; $totalCredit = 0; @endphp @foreach($ledger as $row) @php $totalDebit += $row['debit']; $totalCredit += $row['credit']; @endphp @endforeach
Date Ref Code Narration Debit Credit Balance
{{ $row['date'] }} {{ $row['ref_code'] }} {{ $row['narration'] }} {{ number_format($row['debit'], 2) }} {{ number_format($row['credit'], 2) }} {{ number_format($row['balance'], 2) }}
Total {{ number_format($totalDebit, 2) }} {{ number_format($totalCredit, 2) }} {{ number_format($totalCredit - $totalDebit, 2) }}
@endsection