@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 }}
الفرع: @if(!empty($selectedBranch)) {{ $selectedBranch->branch_no }} - {{ $selectedBranch->name }} @else كل الفروع @endif من تاريخ: {{ $from ?: '-' }} إلى تاريخ: {{ $to ?: '-' }}
قبل الضريبة / قيمة الضريبة / الإجمالي شامل الضريبة
@foreach($tableRows as $r) @endforeach
القسم قبل الضريبة قيمة الضريبة الإجمالي شامل الضريبة
{{ number_format((float)($r['subtotal'] ?? 0), 2) }} {{ number_format((float)($r['vat'] ?? 0), 2) }} {{ number_format((float)($r['total'] ?? 0), 2) }}
Generated by {{ $companyName }} - {{ $printedAt }}