@extends('layouts.master') @section('page_title', 'General Ledger Report') @section('content')

General Ledger Report

Print PDF
General Ledger Report
Period: {{ \Carbon\Carbon::parse($startDate ?? date('Y-01-01'))->format('M j, Y') }} to {{ \Carbon\Carbon::parse($endDate ?? date('Y-m-d'))->format('M j, Y') }} @if(request('account_id')) | Account: {{ $selectedAccount->name ?? 'Selected Account' }} @endif
@if(isset($ledgerData) && $ledgerData->count() > 0) @foreach($ledgerData as $account) @endforeach
Report Summary

{{ $ledgerData->count() }}

Accounts with Activity

{{ number_format($ledgerData->sum('total_debits') ?? 0, 2) }}

Total Debits

{{ number_format($ledgerData->sum('total_credits') ?? 0, 2) }}

Total Credits

@php $totalTransactions = $ledgerData->sum(function($account) { return $account->transactions->count() ?? 0; }); @endphp

{{ $totalTransactions }}

Total Transactions

@else
No Data Found
No transactions were found for the selected criteria. Try adjusting the date range or account filter.
@endif
@endsection