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

Bank Statement

{{-- Filter Form --}}
Statement for {{ $label }}
Opening Balance: UGX {{ number_format($openingBalance ?? 0, 0) }}
Closing Balance: UGX {{ number_format($closingBalance ?? 0, 0) }}
{{-- Transaction Search --}}
{{-- Transactions Table --}} @if ($transactions->count())
@php $runningBalance = $openingBalance ?? 0; $totalDebit = 0; $totalCredit = 0; @endphp @foreach ($transactions as $index => $tx) @php $runningBalance += (float) $tx->debit - (float) $tx->credit; $totalDebit += (float) $tx->debit; $totalCredit += (float) $tx->credit; $lines = \DB::table('journal_entry_lines as l') ->join('accounts as a', 'a.id', '=', 'l.account_id') ->where('l.journal_entry_id', $tx->journal_entry_id) ->select('a.id as account_id', 'a.name as account_name', 'l.debit', 'l.credit', 'l.memo') ->get(); @endphp @endforeach
Date Description Reference Debit Credit Closing Balance
{{ $tx->memo ?? 'N/A' }} {{ $tx->reference ?? '—' }} {{ $tx->debit ? number_format($tx->debit, 0) : '-' }} {{ $tx->credit ? number_format($tx->credit, 0) : '-' }} {{ number_format($runningBalance, 0) }}
Totals {{ number_format($totalDebit, 0) }} {{ number_format($totalCredit, 0) }}
@else
No transactions found for this period.
@endif
{{-- Journal Modal (from Account Details page) --}} @include('accounting.modal.journal_modal', ['accounts' => $accounts])
{{-- Search Filter Script --}} @endsection