@extends('layouts.app', ['page' => 'Account Details', 'pageSlug' => 'accounts', 'section' => 'accounting'])
@section('content')
| 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
|
| Date |
Reference |
Description |
Debit |
Credit |
Balance |
@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
| {{ $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) }} |
@empty
| No transactions found |
@endforelse
@endsection