@extends('layouts.master') @section('css') @endsection @section('title') تقرير العملاء والاشتراكات الشامل @stop @section('page-header') @endsection @section('content')

العملاء بالتقرير / الكلي

{{ $stats['filtered_count'] }} / {{ $stats['total_customers'] }}

إجمالي فروع العملاء

{{ number_format($stats['total_branches']) }}

الفواتير المسددة

{{ number_format($stats['paid_invoices']) }}

غير المسددة

{{ number_format($stats['unpaid_invoices']) }}

الإيرادات المحصلة

{{ number_format($stats['total_revenue'], 2) }} ريال

@forelse ($reports as $customer) @php // جلب أحدث فاتورة مرتبطة بالعميل الحالي لقراءة تفاصيلها $invoice = $customer->invoices->first(); // جلب تفاصيل المبيعات لأحدث فاتورة $saleDetail = $invoice ? $invoice->sales->first() : null; $totalWithTax = $invoice ? ($invoice->cashamount + $invoice->bankamount + $invoice->creaditamount + $invoice->Bank_transfer) : 0; @endphp @empty @endempty
كود العميل العميل / المؤسسة تاريخ التفعيل نوع البرنامج عدد الفروع نوع السيرفر عدد المستخدمين حالة الاشتراك حالة الدفع إجمالي الفاتورة
#{{ $customer->id }}
{{ $customer->name ?? '---' }} {{ $customer->phone ?? '---' }}
{{ $customer->subscription_date ? \Carbon\Carbon::parse($customer->subscription_date)->format('Y-m-d') : '---' }} @if($saleDetail) @if(($saleDetail->software_type ?? 'cloud') == 'cloud') سحابي @else محلي @endif @else --- @endif {{ $saleDetail->branches_count ?? '1' }} @if($customer->server_type == 'new') جديد @elseif($customer->server_type == 'old') قديم @elseif($customer->server_type == 'local') محلي @else --- @endif {{ $saleDetail->users_count ?? '1' }} @if($saleDetail) @if(($saleDetail->software_type ?? 'cloud') == 'local')
مدى الحياة {{ $saleDetail->subscription_start_date ?? '---' }}
@else @if($saleDetail->subscription_end_date) @if(\Carbon\Carbon::parse($saleDetail->subscription_end_date)->isPast()) منتهي ({{ $saleDetail->subscription_end_date }}) @else نشط ({{ $saleDetail->subscription_end_date }}) @endif @else --- @endif @endif @else --- @endif
@if($invoice) {{ $invoice->payment_status == 1 ? 'تم الدفع' : 'لم يتم الدفع' }} @else --- @endif {{ number_format($totalWithTax, 2) }} ريال

لا توجد سجلات عملاء تطابق الفلاتر الحالية

{{ $reports->links() }}
@endsection