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

Account Details

Back to List Edit Account
Account Information

{{ $account->code ?? $account->account_code ?? 'N/A' }}

{{ $account->name }}

{{ $account->accountType->name ?? 'N/A' }} @if($account->accountType) ({{ ucfirst($account->accountType->category) }}) @endif

{{ number_format($account->opening_balance ?? 0, 2) }}

{{ number_format($account->current_balance ?? 0, 2) }}

@if($account->is_active ?? false) Active @else Inactive @endif @if($account->is_system ?? false) System Account @endif

{{ $account->created_at?->format('M d, Y H:i') ?? 'N/A' }}

@if($account->description)

{{ $account->description }}

@endif
Quick Stats
Total Transactions

{{ $account->journalEntryLines->count() ?? 0 }}

Sub Accounts

{{ $account->children->count() ?? 0 }}

@if($account->accountType)
Normal Balance

{{ ucfirst($account->accountType->normal_balance ?? 'N/A') }}

@endif
@if($account->children && $account->children->count() > 0)
Sub Accounts ({{ $account->children->count() }})
@foreach($account->children as $child) @endforeach
Code Name Type Current Balance Status Actions
{{ $child->code ?? $child->account_code }} {{ $child->name }} {{ $child->accountType->name ?? 'N/A' }} {{ number_format($child->current_balance ?? 0, 2) }} @if($child->is_active ?? false) Active @else Inactive @endif View Edit
@endif @if(isset($transactions) && $transactions->count() > 0)
Recent Transactions
Showing {{ $transactions->count() }} of {{ $transactions->total() }} transactions
@php $runningBalance = $account->opening_balance ?? 0; @endphp @foreach($transactions as $transaction) @endforeach
Date Reference Description Debit Credit Balance
{{ $transaction->journalEntry->date ?? $transaction->created_at?->format('M d, Y') }} {{ $transaction->journalEntry->reference ?? 'N/A' }} {{ $transaction->description ?? $transaction->journalEntry->description ?? 'N/A' }} @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 @php $runningBalance += ($transaction->debit_amount - $transaction->credit_amount); @endphp {{ number_format($runningBalance, 2) }}
@if($transactions->hasPages())
{{ $transactions->links('pagination::bootstrap-4') }}
@endif
@elseif($account->journalEntryLines && $account->journalEntryLines->count() > 0)

This account has transactions, but none are currently posted or visible.

@else

No transactions found for this account.

@endif
@endsection @push('styles') @endpush