@php use App\Helpers\Helper; $billFacilityName = $labBrandName ?? 'Veridian Micro Lab Pvt Ltd'; $billFacilityAddress = $branchAddress ?? config('diagnostic.letterhead.address') ?? ''; $billFacilityPhone = $branchPhone ?? config('diagnostic.brand.phone', ''); $billLogoUrl = $branchLogoUrl ?? Helper::publicAsset('assets/img/logo-white.png'); $billLineBadge = $lineCode ?? ($bill->transaction?->dcn ?: 'L1'); $patient = $bill->patient; $ageSex = $patientDemo['ageSex'] ?? '-'; $billDateTime = $bill->created_at ? $bill->created_at->format('d/m/Y, h:i A') : '-'; $billPatientDisplay = '-'; if ($patient) { $namePart = trim((string) ($patient->name ?? '')); $titlePart = $patient->honorificPrefix(); $billPatientDisplay = trim(($titlePart !== '' ? $titlePart . ' ' : '') . $namePart) ?: '-'; } $formatRs = function ($amount) { $amount = (float) $amount; $decimals = floor($amount) == $amount ? 0 : 2; return 'Rs.' . number_format($amount, $decimals); }; @endphp

{{ $billFacilityName }}

@foreach (preg_split('/\r\n|\r|\n/', (string) $billFacilityAddress) ?: [] as $addressLine) @if (trim($addressLine) !== '')

{{ trim($addressLine) }}

@endif @endforeach @if (trim((string) $billFacilityAddress) === '')

—

@endif

Phone no.: {{ $billFacilityPhone }}


Bill / Reg. No. {{ $regNo }}

@if (filled($patient?->uhid))

UHID: {{ $patient->uhid }}

@endif
{{ $billLineBadge }}
Scan to download lab report
Name : {{ $billPatientDisplay }}
Age / Sex : {{ $ageSex }}
Mobile number : {{ $patient?->mobile ?? '-' }}
Referred by : {{ $bill->referred_by ?: 'Self' }}
Date & time : {{ $billDateTime }}
Received by : {{ $receivedBy }}
@forelse ($investigationLines as $index => $line) @php $lineAmount = $line['amount'] ?? null; $amountDisplay = $lineAmount !== null ? $formatRs($lineAmount) : '-'; @endphp @empty @endforelse
S. NO. INVESTIGATIONS AMOUNT
{{ $index + 1 }}. {{ $line['title'] }} {{ $amountDisplay }}
1. — {{ $formatRs((float) $bill->total_amount) }}
Total amount {{ $formatRs((float) $billPrintTotal) }}
Amount paid {{ $formatRs((float) $billPrintPaid) }}
Amount Paid (in words): {{ $amountInWords }}
@if (!empty($cashierSignatureUrl) || !empty($cashierSignatureSrc)) Cashier's signature @else
@endif
Cashier's signature
--- Thank You ---