@php $company = null; try { $company = \Illuminate\Support\Facades\DB::table('company_settings')->where('id', 1)->first(); } catch (\Throwable $e) { $company = null; } $businessName = $company->business_name ?? 'اسم النشاط التجاري'; $logoUrl = (!empty($company->logo_path)) ? asset('storage/'.$company->logo_path) : null; // المستخدم (عود Name) $printedBy = auth()->check() ? (auth()->user()->name ?? '') : ''; // التاريخ بصيغة dd/MM/yyyy مع الوقت $printedAt = now()->format('d/m/Y H:i'); // الفرع حسب الفلتر $branchLabel = 'كل الفروع'; if ((int)($branchId ?? 0)) { $b = $branches->firstWhere('id', (int)$branchId); $branchLabel = $b ? ($b->branch_no.' - '.$b->name) : ('فرع #' . (int)$branchId); } @endphp
الرئيسية
@csrf
تقرير شامل تقرير المبيعات تقرير المشتريات تقرير المصروفات
{{ $businessName }}
تقرير شامل (مبيعات / مشتريات / مصروفات)
الفترة: {{ $from }} → {{ $to }}
الفرع: {{ $branchLabel }}
طبع بواسطة: {{ $printedBy ?: '-' }}
تاريخ الطباعة: {{ $printedAt }}
القسم قبل الضريبة الضريبة بعد الضريبة
المبيعات {{ number_format($sales['subtotal'] ?? 0, 2) }} {{ number_format($sales['vat'] ?? 0, 2) }} {{ number_format($sales['total'] ?? 0, 2) }}
المشتريات {{ number_format($purchases['subtotal'] ?? 0, 2) }} {{ number_format($purchases['vat'] ?? 0, 2) }} {{ number_format($purchases['total'] ?? 0, 2) }}
المصروفات {{ number_format($expenses['subtotal'] ?? 0, 2) }} {{ number_format($expenses['vat'] ?? 0, 2) }} {{ number_format($expenses['total'] ?? 0, 2) }}
الصافي بعد الضريبة
{{ number_format($netTotal ?? 0, 2) }}
صافي الضريبة
{{ number_format($netVat ?? 0, 2) }}