@extends('print.layout')
@section('title', 'Receipt - ' . $tab->tab_number)
@php
$paperWidth = 58;
$billable = $split ?? $tab;
$sym = config('pos.company.currency_symbol');
$receiptBranch = !empty($tab->branch_id) ? \App\Models\Branch::find($tab->branch_id) : null;
$branchReceipt = (array) ($receiptBranch?->receipt_settings ?? []);
$receiptName = $branchReceipt['business_name'] ?? $receiptBranch?->name ?? config('pos.company.name');
$receiptTill = $branchReceipt['till_number'] ?? \App\Models\Setting::get('general', 'till_number', config('pos.company.till_number'));
$receiptPaybill = $branchReceipt['paybill_number'] ?? \App\Models\Setting::get('general', 'paybill_number', config('pos.company.paybill_number'));
$receiptPhone = $branchReceipt['phone'] ?? $receiptBranch?->phone ?? \App\Models\Setting::get('general', 'business_phone', config('pos.company.phone', ''));
$receiptAddress = $branchReceipt['address'] ?? $receiptBranch?->address ?? config('pos.company.address');
$receiptAltPhone = $branchReceipt['alternative_phone'] ?? \App\Models\Setting::get('general', 'alternative_phone', '');
$receiptEmail = $branchReceipt['email'] ?? \App\Models\Setting::get('general', 'business_email', '');
$receiptWebsite = $branchReceipt['website'] ?? \App\Models\Setting::get('general', 'business_website', '');
$receiptPin = $branchReceipt['kra_pin'] ?? \App\Models\Setting::get('general', 'company_pin', config('pos.company.kra_pin', ''));
$receiptLogo = $branchReceipt['logo_path'] ?? \App\Models\Setting::get('general', 'logo_path', config('pos.company.logo_path'));
$receiptLogoUrl = $receiptLogo ? \Illuminate\Support\Facades\Storage::disk('public')->url($receiptLogo) : null;
@endphp
@section('content')
@if ($receiptLogoUrl)

@endif
{{ $receiptName }}
@if ($receiptAddress){{ $receiptAddress }}
@endif
@if ($receiptPhone){{ $receiptPhone }}
@endif
@if ($receiptAltPhone)Alt: {{ $receiptAltPhone }}
@endif
@if ($receiptEmail){{ $receiptEmail }}
@endif
@if ($receiptWebsite){{ $receiptWebsite }}
@endif
@if ($receiptPin)KRA PIN: {{ $receiptPin }}
@endif
BAR
@if ($receiptTill || $receiptPaybill)
@if ($receiptTill) Till: {{ $receiptTill }} @endif
@if ($receiptTill && $receiptPaybill) · @endif
@if ($receiptPaybill) Paybill: {{ $receiptPaybill }} @endif
@endif
Tab: {{ $tab->tab_number }}
@if ($split){{ $split->label }}
@endif
{{ $tab->customer_name ?? 'Walk-in' }}
Bartender: {{ $tab->bartender->name ?? '-' }}
{{ now(config('pos.company.timezone', 'Africa/Nairobi'))->format('d M Y, H:i') }}
@forelse (($split ? $split->items : $tab->items) as $item)
@if ($item->status !== 'void')
| {{ $item->quantity }}x {{ $item->product->name }}@if($item->is_complimentary) (comp)@endif @if($item->discount_percent > 0)(-{{ rtrim(rtrim(number_format($item->discount_percent, 2), '0'), '.') }}%)@endif |
{{ number_format($item->line_total, 2) }} |
@endif
@empty
| No items |
@endforelse
| Subtotal | {{ number_format($billable->subtotal, 2) }} |
@php $happySaved = ($split ? $split->items : $tab->items)->where('status', '!=', 'void')->sum(fn ($i) => $i->original_price ? ((float) $i->original_price - (float) $i->unit_price) * $i->quantity : 0); @endphp
@if ($happySaved > 0)| Happy hour saved | {{ number_format($happySaved, 2) }} |
@endif
| Discount | -{{ number_format($billable->discount_total, 2) }} |
| VAT | {{ number_format($billable->tax_total, 2) }} |
| Levy | {{ number_format($billable->levy_total, 2) }} |
| TOTAL | {{ $sym }} {{ number_format($billable->grand_total, 2) }} |
Payments
@forelse (($split ? $split->payments : $tab->payments) as $payment)
{{ $payment->paymentMethod->name ?? $payment->method }}
{{ number_format($payment->amount, 2) }}
@if ($payment->reference_number)
Ref: {{ $payment->reference_number }}
@endif
@empty
No payment recorded yet
@endforelse
Thank you!
@endsection