@extends('layouts.admin')
@section('title', __('Dashboard'))
@section('page_title', 'لوحة المحاسبة')
@section('content')
@include('dashboard._kpi', ['label' => 'تحصيل اليوم', 'value' => number_format($kpis['collected_today'], 0), 'color' => 'success', 'icon' => 'cash', 'sub' => 'ج.م'])
@include('dashboard._kpi', ['label' => 'تحصيل الشهر', 'value' => number_format($kpis['collected_month'], 0), 'color' => 'primary', 'icon' => 'wallet', 'sub' => 'ج.م'])
@include('dashboard._kpi', ['label' => 'فواتير غير مدفوعة','value' => $kpis['unpaid_invoices'], 'color' => 'warning', 'icon' => 'receipt', 'sub' => 'فاتورة'])
@include('dashboard._kpi', ['label' => 'متأخرات', 'value' => $kpis['overdue_count'], 'color' => 'danger', 'icon' => 'exclamation-triangle', 'sub' => 'فاتورة'])
@include('dashboard._kpi', ['label' => 'إجمالي المستحقات', 'value' => number_format($kpis['outstanding_total'], 0), 'color' => 'light text-dark', 'col' => 6, 'icon' => 'cash-stack', 'sub' => 'ج.م'])
@include('dashboard._kpi', ['label' => 'إجمالي المتأخرات', 'value' => number_format($kpis['overdue_total'], 0), 'color' => 'danger', 'col' => 6, 'icon' => 'exclamation-circle', 'sub' => 'ج.م'])
@foreach($buckets as $bucket => $total)
@php
$cls = match($bucket) { '0-30' => 'success', '31-60' => 'warning text-dark', '61-90' => 'danger', '90+' => 'dark', default => 'secondary' };
@endphp
| {{ $bucket }} يوم |
{{ number_format($total, 2) }} |
@endforeach
| الكود | العميل | الهاتف | الرصيد |
@forelse($topDebtors as $c)
| {{ $c->code }} |
{{ $c->name }} |
{{ $c->phone }} |
{{ number_format((float) $c->balance, 2) }} |
@empty
| لا يوجد مدينون |
@endforelse
| التاريخ | العميل | الطريقة | المبلغ |
@forelse($recentPayments as $p)
| {{ $p->payment_date?->format('d/m/Y') }} |
{{ $p->customer?->name }} |
{{ $p->method_label }} |
{{ number_format((float) $p->amount, 2) }} |
@empty
| لا توجد مدفوعات حديثة |
@endforelse
@endsection
@push('scripts')
@endpush