@extends('layouts.master') @section('title') {{ $data ? 'كشف حساب: ' . $data['account']->name : 'كشف حساب' }} @endsection @section('css') @endsection @section('content') @php $f = $filters; $fmt = fn ($v) => number_format((float) $v, 2); $qs = http_build_query(array_filter($f, fn ($v) => $v !== null && $v !== '')); @endphp

{{ $data ? 'كشف حساب: ' . $data['account']->name : 'كشف حساب' }}

@if ($data)
رقم الحساب: {{ $data['account']->account_number }} @if ($data['account']->parent_name)  |  الحساب الأب: {{ $data['account']->parent_name }} @endif @if ($data['is_parent'])  |  حساب تجميعي (يشمل الحسابات الفرعية) @endif  |  طبيعته: {{ $data['debit_nature'] ? 'مدين' : 'دائن' }}
@else
اختر الحساب والفترة ثم اضغط فلترة
@endif
@php $mergedNames = \Illuminate\Support\Facades\DB::table('financial_accounts') ->whereIn('id', array_filter([(int) ($f['customer_account_id'] ?? 0), (int) ($f['supplier_account_id'] ?? 0)])) ->get(['id', 'name', 'account_number'])->keyBy('id'); $mName = fn ($id) => ($id && isset($mergedNames[(int) $id])) ? $mergedNames[(int) $id]->account_number . ' — ' . $mergedNames[(int) $id]->name : ''; @endphp
@if ($data)
رصيد افتتاحي (بداية الفترة)
{{ $fmt($data['opening']) }}
إجمالي المدين
{{ $fmt($data['total_debit']) }}
إجمالي الدائن
{{ $fmt($data['total_credit']) }}
الرصيد الختامي
{{ $fmt($data['closing']) }}
@include('account_statement._table', ['data' => $data, 'badges' => $badges])
@endif
@endsection @section('js') @endsection