{{-- One payment receipt in either print type (see receipt_print_type()): 'pos' — an 80mm thermal roll, 'a4' — a full page with the shared print header. $r comes from App\Services\ReceiptData; $receipts (a list of $r) prints several one after the other (Bill → Unpaid Bills). --}} @php $format = $format ?? 'a4'; $receipts = $receipts ?? [$r]; $company = get_company_settings(); $sym = $company->currency_symbol ?: '$'; @endphp {{ $receipts[0]['title'] ?? 'Receipt' }} {{-- ?view=1 = opened just to look at (e.g. lab "View Tests" modal, which has its own Print button) --}} boolean('view')) onload="window.print()" @endunless> @foreach ($receipts as $r) @if ($format === 'pos')
@if ($company->logo && is_file('storage/settings/' . $company->logo)) @endif

{{ $company->company_name }}

@if ($company->address)
{{ $company->address }}
@endif @if ($company->phone)
{{ $company->phone }}
@endif
{{ $r['title'] }}
Receipt No: {{ $r['number'] }}
Date: {{ $r['date'] }}
Patient: {{ $r['patient'] ?? '-' }}{{ !empty($r['patient_code']) ? ' (' . $r['patient_code'] . ')' : '' }}
@if (!empty($r['doctor']))
Doctor: {{ $r['doctor'] }}
@endif @foreach ($r['extra'] ?? [] as $label => $value)
{{ $label }}: {{ $value }}
@endforeach
@if (empty($r['hide_prices']))@endif @foreach ($r['lines'] as $l) @if (empty($r['hide_prices']))@endif @endforeach
ItemAmount
{{ $l['name'] }}{{ !empty($l['qty']) ? ' x' . $l['qty'] : '' }}{{ number_format($l['amount'], 2) }}
@if (empty($r['hide_prices']))
@if ($r['discount'] > 0)@endif
Total{{ $sym }} {{ number_format($r['total'], 2) }}
Discount{{ $sym }} {{ number_format($r['discount'], 2) }}
Paid{{ $sym }} {{ number_format($r['paid'], 2) }}
Balance{{ $sym }} {{ number_format($r['balance'], 2) }}
@endif @if (!empty($r['methods']))
Paid by: {{ $r['methods'] }}
@endif
Cashier: {{ $r['cashier'] ?? auth()->user()?->name }}
--- Thank you ---
{{ now()->format('d M, Y h:i A') }}
@else
@include('layouts.print_header', ['printTitle' => $r['title']]) @if (!empty($r['doctor']) || !empty($r['extra'])) @endif
Patient: {{ $r['patient'] ?? '-' }}{{ !empty($r['patient_code']) ? ' (' . $r['patient_code'] . ')' : '' }} Receipt No: {{ $r['number'] }}
@if (!empty($r['phone']))Phone: {{ $r['phone'] }}@endif Date: {{ $r['date'] }}
@if (!empty($r['doctor']))Doctor: {{ $r['doctor'] }}@endif @foreach ($r['extra'] ?? [] as $label => $value) {{ $label }}: {{ $value }}@if (!$loop->last) · @endif @endforeach
@if (empty($r['hide_prices']))@endif @foreach ($r['lines'] as $i => $l) @if (empty($r['hide_prices']))@endif @endforeach
# Item QtyAmount
{{ $i + 1 }} {{ $l['name'] }} {{ $l['qty'] ?? 1 }}{{ number_format($l['amount'], 2) }}
@if (empty($r['hide_prices']))
Total{{ $sym }} {{ number_format($r['total'], 2) }}
Discount{{ $sym }} {{ number_format($r['discount'], 2) }}
Paid{{ $sym }} {{ number_format($r['paid'], 2) }}
Balance{{ $sym }} {{ number_format($r['balance'], 2) }}
@endif

@if (!empty($r['methods']))Paid by: {{ $r['methods'] }}  ·  @endif Cashier: {{ $r['cashier'] ?? auth()->user()?->name }}

Cashier
Patient
@endif @endforeach