{{--
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
@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
| Item | @if (empty($r['hide_prices']))Amount | @endif
@foreach ($r['lines'] as $l)
| {{ $l['name'] }}{{ !empty($l['qty']) ? ' x' . $l['qty'] : '' }} |
@if (empty($r['hide_prices'])){{ number_format($l['amount'], 2) }} | @endif
@endforeach
@if (empty($r['hide_prices']))
| Total | {{ $sym }} {{ number_format($r['total'], 2) }} |
@if ($r['discount'] > 0)| Discount | {{ $sym }} {{ number_format($r['discount'], 2) }} |
@endif
| 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']])
| 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']) || !empty($r['extra']))
| @if (!empty($r['doctor']))Doctor: {{ $r['doctor'] }}@endif |
@foreach ($r['extra'] ?? [] as $label => $value)
{{ $label }}: {{ $value }}@if (!$loop->last) · @endif
@endforeach
|
@endif
| # |
Item |
Qty |
@if (empty($r['hide_prices']))Amount | @endif
@foreach ($r['lines'] as $i => $l)
| {{ $i + 1 }} |
{{ $l['name'] }} |
{{ $l['qty'] ?? 1 }} |
@if (empty($r['hide_prices'])){{ number_format($l['amount'], 2) }} | @endif
@endforeach
@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 }}
@endif
@endforeach