@extends('layouts.app', ['page' => 'Account Details', 'pageSlug' => 'accounts', 'section' => 'accounting']) @section('content')

Account Details

Account Code {{ $account->code }}
Name {{ $account->name }}
Type {{ ucfirst($account->type) }}
Subtype {{ $account->subtype ? ucfirst($account->subtype) : '-' }}
Parent Account {{ $account->parent ? $account->parent->code . ' - ' . $account->parent->name : 'None' }}
Description {{ $account->description ?: 'No description' }}
Current Balance {{ money($account->getCurrentBalance()) }}
Status @if($account->is_active) Active @else Inactive @endif

Recent Transactions

@php $balance = 0; @endphp @forelse($account->journalLines()->with('journalEntry')->orderBy('created_at', 'desc')->limit(10)->get() as $line) @php if (in_array($account->type, ['asset', 'expense'])) { $balance += $line->debit - $line->credit; } else { $balance += $line->credit - $line->debit; } @endphp @empty @endforelse
Date Reference Description Debit Credit Balance
{{ $line->journalEntry->entry_date }} {{ $line->journalEntry->reference }} {{ $line->description ?: $line->journalEntry->description }} {{ $line->debit > 0 ? money($line->debit) : '' }} {{ $line->credit > 0 ? money($line->credit) : '' }} {{ money($balance) }}
No transactions found
@endsection