@extends('layouts.app') @section('title', 'Account Details') @section('content')

Account Details

Back to List @can('edit accounts') Edit @endcan

Account Information

Account Code

{{ $account->account_code }}

Account Name

{{ $account->account_name }}

Account Type

{{ $account->accountType->name }}

Normal Balance: {{ ucfirst($account->accountType->normal_balance) }}

Status

{{ $account->is_active ? 'Active' : 'Inactive' }}
@if($account->parentAccount)

Parent Account

{{ $account->parentAccount->account_code }} - {{ $account->parentAccount->account_name }}
@endif @if($account->description)

Description

{{ $account->description }}

@endif
@if($account->subAccounts->count() > 0)

Sub-Accounts

@foreach($account->subAccounts as $subAccount) @endforeach
Account Code Account Name Status Actions
{{ $subAccount->account_code }} {{ $subAccount->account_name }} {{ $subAccount->is_active ? 'Active' : 'Inactive' }} View
@endif @php $currentBalance = $account->balances() ->where('fiscal_year', now()->year) ->where('fiscal_period', now()->month) ->first(); @endphp @if($currentBalance)

Current Period Balance

Opening Balance

LKR {{ number_format($currentBalance->opening_balance, 2) }}

Total Debits

LKR {{ number_format($currentBalance->debit_total, 2) }}

Total Credits

LKR {{ number_format($currentBalance->credit_total, 2) }}

Closing Balance

LKR {{ number_format($currentBalance->closing_balance, 2) }}

@endif @php $recentTransactions = $account->journalEntryLines() ->whereHas('journalEntry', function($query) { $query->where('status', 'posted'); }) ->with(['journalEntry']) ->latest() ->limit(10) ->get(); @endphp @if($recentTransactions->count() > 0)

Recent Transactions

View All
@foreach($recentTransactions as $line) @endforeach
Date Entry Number Description Debit Credit
{{ $line->journalEntry->entry_date->format('M d, Y') }} {{ $line->journalEntry->entry_number }} {{ Str::limit($line->description ?? $line->journalEntry->description, 40) }} @if($line->debit_amount > 0) {{ number_format($line->debit_amount, 2) }} @else - @endif @if($line->credit_amount > 0) {{ number_format($line->credit_amount, 2) }} @else - @endif
@endif

Actions

@can('edit accounts') Edit Account @endcan @can('delete accounts')
@csrf @method('DELETE')
@endcan Back to List
@endsection