@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 ''; } } $quotationType = 'B2B'; if (is_array($rows)) { $firstRow = reset($rows); if (is_array($firstRow) && !empty($firstRow['SERVICE_TYPE'])) $quotationType = $firstRow['SERVICE_TYPE']; } $recipientName = $endUser->FULL_NAME ?? $recipient ?? '-'; @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:
{{ $recipientName }}
Branch:
{{ $hospital->BRANCH_NAME ?? $hospital->NAME_EN ?? 'Branch Name' }}
Quotation Type:
{{ $quotationType }}
Tests Count:
{{ $packages_count }} Test(s)
Date:
{{ $date }}
QUOTATION
@foreach($rows as $row) {{-- The before price is struck through only where there is a discount to show. --}} @endforeach
Service ID Name Service Type Service Code TAT (Days) STAT Sample Type Price (Before Discount) Discount % Price (After Discount)
{{ $row['ID'] }} {{ $row['NAME'] }} {{ $row['SERVICE_TYPE'] }} {{ $row['CODE'] }} {{ $row['TAT'] ?? '-' }} {{ $row['STAT'] ?? '-' }} {{ $row['SAMPLE_TYPE'] !== '' ? $row['SAMPLE_TYPE'] : '-' }}{{ number_format($row['PRICE_BEFORE'], 2) }} {{ rtrim(rtrim(number_format($row['DISCOUNT'], 2), '0'), '.') }}% {{ number_format($row['PRICE_AFTER'], 2) }}