@extends('layouts.master') @section('page_title', 'Account Statement') @section('content')

Account Statement

Back to Chart of Accounts Print PDF
Account Information
Account Code: {{ $account->code ?? $account->account_code }}
Account Name: {{ $account->name }}
Account Type: {{ $account->accountType->name ?? 'N/A' }} @if($account->accountType) {{ ucfirst($account->accountType->category) }} @endif
Normal Balance: {{ ucfirst($account->accountType->normal_balance ?? 'N/A') }}
Statement Period: {{ \Carbon\Carbon::parse($startDate)->format('M d, Y') }} to {{ \Carbon\Carbon::parse($endDate)->format('M d, Y') }}
Opening Balance: {{ number_format($openingBalance, 2) }}
Closing Balance: {{ number_format($closingBalance, 2) }}
Status: @if($account->is_active) Active @else Inactive @endif
@if($account->description)
Description: {{ $account->description }}
@endif
Transaction History
{{ $transactions->count() }} Transactions
@if($transactions->count() > 0)
@foreach($transactions as $transaction) @endforeach
Date Reference Description Debit Credit Balance Action
Opening Balance as of {{ \Carbon\Carbon::parse($startDate)->format('M d, Y') }} - - {{ number_format($openingBalance, 2) }} -
{{ $transaction->journalEntry->entry_date ? \Carbon\Carbon::parse($transaction->journalEntry->entry_date)->format('M d, Y') : 'N/A' }} {{ $transaction->journalEntry->entry_number ?? 'N/A' }}
{{ $transaction->description ?: $transaction->journalEntry->description }}
@if($transaction->description && $transaction->journalEntry->description && $transaction->description !== $transaction->journalEntry->description) Entry: {{ $transaction->journalEntry->description }} @endif
@if($transaction->debit_amount > 0) {{ number_format($transaction->debit_amount, 2) }} @else - @endif @if($transaction->credit_amount > 0) {{ number_format($transaction->credit_amount, 2) }} @else - @endif {{ number_format($transaction->running_balance, 2) }}
Closing Balance as of {{ \Carbon\Carbon::parse($endDate)->format('M d, Y') }} - - {{ number_format($closingBalance, 2) }} -
Period Summary
@php $totalDebits = $transactions->sum('debit_amount'); $totalCredits = $transactions->sum('credit_amount'); $netMovement = $closingBalance - $openingBalance; $transactionCount = $transactions->count(); $averageTransaction = $transactionCount > 0 ? ($totalDebits + $totalCredits) / $transactionCount : 0; @endphp

{{ $transactionCount }}

Transactions

{{ number_format($totalDebits, 2) }}

Total Debits

{{ number_format($totalCredits, 2) }}

Total Credits

{{ number_format($netMovement, 2) }}

Net Movement

{{ number_format($averageTransaction, 2) }}

Avg Transaction

{{ number_format($closingBalance, 2) }}

Final Balance

@else
No Transactions Found

This account has no transactions for the selected period.

Period: {{ \Carbon\Carbon::parse($startDate)->format('M d, Y') }} to {{ \Carbon\Carbon::parse($endDate)->format('M d, Y') }}
@endif
@endsection