@php $printedAt = now()->format('d-m-Y H:i'); $companyName = config('app.name', 'Laundry Dashboard'); $logoSrc = null; try { $company = \Illuminate\Support\Facades\DB::table('company_settings')->first(); if ($company && !empty($company->business_name)) { $companyName = $company->business_name; } $logoPath = $company && !empty($company->logo_path) ? trim((string)$company->logo_path) : ''; $candidateFiles = []; if ($logoPath !== '') { $candidateFiles[] = storage_path('app/public/' . ltrim($logoPath, '/')); $candidateFiles[] = public_path('storage/' . ltrim($logoPath, '/')); $candidateFiles[] = public_path(ltrim($logoPath, '/')); } $candidateFiles[] = public_path('logo.png'); foreach ($candidateFiles as $file) { if ($file && file_exists($file) && is_file($file)) { $mime = function_exists('mime_content_type') ? mime_content_type($file) : 'image/png'; if (!$mime) $mime = 'image/png'; $logoSrc = 'data:' . $mime . ';base64,' . base64_encode(file_get_contents($file)); break; } } } catch (\Throwable $e) { $companyName = config('app.name', 'Laundry Dashboard'); $logoSrc = null; } @endphp
رجوع لتقرير المصروفات
{{ $companyName }}
نظام التقارير المالية
@if($logoSrc) Logo @else
LOGO
@endif
تقرير المصروفات
تاريخ الطباعة: {{ $printedAt }}
الفرع: {{ $selectedBranch ? ($selectedBranch->branch_no . ' - ' . $selectedBranch->name) : 'كل الفروع' }} المصروف الرئيسي: {{ $selectedCategory ? $selectedCategory->name : 'كل المصروفات' }} المصروف الفرعي: {{ $selectedSubcat ? $selectedSubcat->name : 'كل التفاصيل' }} من تاريخ: {{ $from ?: '-' }} إلى تاريخ: {{ $to ?: '-' }}
عدد الفواتير
{{ number_format((int)($totals->invoices_count ?? 0)) }}
قبل الضريبة
{{ number_format((float)($totals->subtotal ?? 0), 2) }}
قيمة الضريبة
{{ number_format((float)($totals->vat_amount ?? 0), 2) }}
الإجمالي شامل الضريبة
{{ number_format((float)($totals->total ?? 0), 2) }}
ملخص المصروفات حسب الفرع
@forelse($byBranch as $r) @empty @endforelse
رقم الفرعاسم الفرععدد الفواتيرقبل الضريبةقيمة الضريبةالإجمالي شامل الضريبة
{{ $r->branch_no }} {{ $r->name }} {{ number_format((int)$r->invoices_count) }} {{ number_format((float)$r->subtotal, 2) }} {{ number_format((float)$r->vat_amount, 2) }} {{ number_format((float)$r->total, 2) }}
لا توجد بيانات
الإجمالي {{ number_format((int)($totals->invoices_count ?? 0)) }} {{ number_format((float)($totals->subtotal ?? 0), 2) }} {{ number_format((float)($totals->vat_amount ?? 0), 2) }} {{ number_format((float)($totals->total ?? 0), 2) }}
ملخص المصروفات حسب الرئيسي
@forelse($byCat as $r) @empty @endforelse
المصروف الرئيسيعدد الفواتيرقبل الضريبةقيمة الضريبةالإجمالي شامل الضريبة
{{ $r->name }} {{ number_format((int)$r->invoices_count) }} {{ number_format((float)$r->subtotal, 2) }} {{ number_format((float)$r->vat_amount, 2) }} {{ number_format((float)$r->total, 2) }}
لا توجد بيانات
الإجمالي {{ number_format((int)($totals->invoices_count ?? 0)) }} {{ number_format((float)($totals->subtotal ?? 0), 2) }} {{ number_format((float)($totals->vat_amount ?? 0), 2) }} {{ number_format((float)($totals->total ?? 0), 2) }}
ملخص المصروفات حسب الفرعي
@forelse($bySub as $r) @empty @endforelse
المصروف الرئيسيالمصروف الفرعيعدد الفواتيرقبل الضريبةقيمة الضريبةالإجمالي شامل الضريبة
{{ $r->category_name }} {{ $r->name }} {{ number_format((int)$r->invoices_count) }} {{ number_format((float)$r->subtotal, 2) }} {{ number_format((float)$r->vat_amount, 2) }} {{ number_format((float)$r->total, 2) }}
لا توجد بيانات
الإجمالي {{ number_format((int)($totals->invoices_count ?? 0)) }} {{ number_format((float)($totals->subtotal ?? 0), 2) }} {{ number_format((float)($totals->vat_amount ?? 0), 2) }} {{ number_format((float)($totals->total ?? 0), 2) }}
Generated by {{ $companyName }} - {{ $printedAt }}