@extends('layouts.app') @section('content')
كشف حساب: {{ $account->code }} - {{ $account->name }}
رجوع
النوع: {{ $account->type }}
الحساب الرئيسي: {{ optional($account->parent)->name ?? '—' }}
الوصف: {{ $account->description ?? '—' }}
@if($account->children->count() > 0)
الحسابات الفرعية
@foreach($account->children as $child) @endforeach
الكودالاسم
{{ $child->code }} {{ $child->name }}
@endif
حركة الحساب
@php $balance = 0; @endphp @foreach($lines->reverse() as $line) @php // Simple running balance calculation (reset on pagination, ideal would be calculated in DB or efficient way) // For asset/expense: debit increases, credit decreases // For liability/equity/revenue: credit increases, debit decreases if(in_array($account->type, ['asset','expense'])) { $balance += $line->debit - $line->credit; } else { $balance += $line->credit - $line->debit; } @endphp @endforeach @if($lines->isEmpty()) @endif
التاريخ رقم القيد البيان مدين دائن الرصيد
{{ optional($line->journalEntry)->date->format('Y-m-d') }} {{ $line->journal_entry_id }} {{ optional($line->journalEntry)->description }} {{ number_format($line->debit, 2) }} {{ number_format($line->credit, 2) }} {{ number_format($balance, 2) }}
لا توجد حركات
{{ $lines->links() }}
@endsection