@php if (!function_exists('getBase64OrUrlContent')) { function getBase64OrUrlContent($imagePath) { if (filter_var($imagePath, FILTER_VALIDATE_URL)) return $imagePath; $fullPath = public_path($imagePath); if ($fullPath && file_exists($fullPath)) { $ext = pathinfo($fullPath, PATHINFO_EXTENSION); $data = @file_get_contents($fullPath); if ($data !== false) return 'data:image/' . $ext . ';base64,' . base64_encode($data); } return ''; } } // SAR icon helper - guarded against missing file (prevents PDF break) $sarIconBase64 = ''; $sarPath = public_path('img/sar.svg'); if (file_exists($sarPath)) { $sarData = @file_get_contents($sarPath); if ($sarData !== false) $sarIconBase64 = base64_encode($sarData); } @endphp
{{-- First-page header only (not repeated) --}}
@if (!empty($hospital->REPORT_HEADER))
Report Header
@elseif (!empty($profile->REPORT_HEADER))
Report Header
@else
@php $leftLogo = $hospital->REPORT_LEFT_LOGO ?? $profile->LEFT_LOGO ?? null; @endphp @if($leftLogo)
@endif @php $midLogo = $hospital->REPORT_MID_LOGO ?? $profile->LOGO ?? null; @endphp @if($midLogo)
@endif @php $rightLogo = $hospital->REPORT_RIGHT_LOGO ?? $profile->RIGHT_LOGO ?? null; @endphp @if($rightLogo)
@endif
@endif
Lab:
{{ $hospital->NAME_EN ?? 'Hospital Name' }}
User:
{{ $endUser->FULL_NAME ?? '-' }}
Branch:
{{ $hospital->BRANCH_NAME ?? $hospital->NAME_EN ?? 'Branch Name' }}
Quotation Type:
@if(isset($packages->first()->TYPE_TITLE)){{ $packages->first()->TYPE_TITLE }}@else Standard @endif
Tests Count:
{{ $packages_count }} Test(s)
Date:
{{ $date }}
QUOTATION
@foreach($packages as $package) @endforeach
Code Test & Sample Sample Type Sample Condition TAT (Days) STAT Price
{{ $package->test_code }}
{{ $package->NAME_EN }}
{{ \Illuminate\Support\Str::limit($package->sample_type ?? '-', 120) }}
{{ \Illuminate\Support\Str::limit($package->sample_conditions ?? '-', 180) }}
{{ $package->formatted_tat !== '' ? $package->formatted_tat : '-' }}
-
@if($disable_price)
Price on Request
@else
{{ number_format($package->PRICE, 2) }} @if($currency === 'SAR') @if($sarIconBase64 !== '') SAR @else SAR @endif @else {{ $currency }} @endif
@endif
@if(!$disable_price)
الاجمالي الخاضع للضريبة
(غير شامل ضريبة القيمة المضافة)
Total Taxable Amount
(Excluding VAT)
{{ number_format($subtotal, 2) }} @if($currency === 'SAR') @if($sarIconBase64 !== '') SAR @else SAR @endif @else {{ $currency }} @endif
مجموع ضريبة القيمة المضافة
Total VAT
{{ number_format($tax_amount, 2) }} @if($currency === 'SAR') @if($sarIconBase64 !== '') SAR @else SAR @endif @else {{ $currency }} @endif
إجمالي المبلغ المستحق
Total Amount Due
{{ number_format($total, 2) }} @if($currency === 'SAR') @if($sarIconBase64 !== '') SAR @else SAR @endif @else {{ $currency }} @endif
@endif