@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; } $methodLabel = $payment->payment_method; if ($payment->payment_method === 'cash') $methodLabel = 'كاش'; if ($payment->payment_method === 'card') $methodLabel = 'شبكة'; if ($payment->payment_method === 'bank_transfer') $methodLabel = 'تحويل بنكي'; @endphp
رجوع
@if(($payment->status ?? 'active') === 'cancelled')
ملغي
@endif
{{ $companyName }}
نظام المشتريات والمدفوعات
@if($logoSrc) Logo @else
LOGO
@endif
{{ ($payment->status ?? 'active') === 'cancelled' ? 'سند دفع مورد ملغي' : 'سند دفع مورد' }}
تاريخ الطباعة: {{ $printedAt }}
رقم السند: {{ $payment->voucher_no_branch }}
@if(($payment->status ?? 'active') === 'cancelled')
هذا السند ملغي ولا يتم احتسابه في كشف الحساب أو أرصدة الموردين.
سبب الإلغاء: {{ $payment->cancel_reason ?: '-' }}
@endif
التاريخ {{ \Carbon\Carbon::parse($payment->payment_date)->format('d-m-Y') }}
الفرع {{ $payment->branch_no }} - {{ $payment->branch_name }}
المورد {{ $payment->supplier_name }}
طريقة الدفع {{ $methodLabel }}
حالة السند {{ ($payment->status ?? 'active') === 'cancelled' ? 'ملغي' : 'نشط' }}
رقم المرجع {{ $payment->reference_no ?: '-' }}
المستخدم {{ $payment->created_by_name ?: '-' }}
ملاحظات {{ $payment->notes ?: '-' }}
@if(($payment->status ?? 'active') === 'cancelled')
هذا السند ملغي ولا يمثل دفعة صحيحة، ولا يتم احتسابه في رصيد المورد أو كشف الحساب.
سبب الإلغاء: {{ $payment->cancel_reason ?: '-' }}
@endif
{{ number_format((float)$payment->amount, 2) }}
توقيع المستلم
توقيع المحاسب