@extends('layouts.app') @section('title', 'دفتر الأستاذ') @section('page_title', 'تقرير كشف حساب (دفتر الأستاذ العام)') @section('content')
@if($selectedAccount)

كشف حساب: {{ $selectedAccount->name }}

كود الحساب: {{ $selectedAccount->code }} | الفترة من {{ $fromDate }} إلى {{ $toDate }}

الرصيد الافتتاحي المسبق:

{{ number_format($openingBalance, 2) }} ر.س

@php $runningBalance = $openingBalance; @endphp @forelse($lines as $line) @php $debit = (double)$line->debit; $credit = (double)$line->credit; if (in_array($selectedAccount->type, ['asset', 'expense'])) { $runningBalance += ($debit - $credit); } else { $runningBalance += ($credit - $debit); } @endphp @empty @endforelse
تاريخ المعاملة رقم القيد بيان المعاملة مدين (+) دائن (-) الرصيد التراكمي
رصيد أول المدة الافتتاحي للتقرير - - {{ number_format($openingBalance, 2) }} ر.س
{{ $line->journalEntry->entry_date->format('Y-m-d') }} {{ $line->journalEntry->entry_number }} {{ $line->description ?? $line->journalEntry->description }} {{ $debit > 0 ? number_format($debit, 2) : '-' }} {{ $credit > 0 ? number_format($credit, 2) : '-' }} {{ number_format($runningBalance, 2) }} ر.س
لا توجد حركات مسجلة خلال هذه الفترة.
إجمالي حركة المدين {{ number_format($lines->sum('debit'), 2) }} ر.س
إجمالي حركة الدائن {{ number_format($lines->sum('credit'), 2) }} ر.س
الرصيد الختامي للدليل {{ number_format($runningBalance, 2) }} ر.س
@endif
@endsection