@extends('receipts.layout') {{-- A Reports Hub report as a printable document. A4 prints the on-screen layout (statements keep their own layout). On 80mm / 58mm thermal roll a table can't fit, so every row stacks: its text columns as a heading line, then each amount as a "label … value" line — the same rows and totals the Excel export carries. --}} @php $money = fn ($n) => $n === null || $n === '' ? '' : (((float) $n < 0 ? '(' : '') . number_format(abs((float) $n), 2) . ((float) $n < 0 ? ')' : '')); $isAmount = fn ($col) => !empty($col['money']) || ($col['align'] ?? '') === 'right'; $textCols = collect($result->columns)->reject($isAmount)->values(); $amountCols = collect($result->columns)->filter($isAmount)->values(); $cell = function ($col, $value) use ($money) { if (!empty($col['money'])) { return $money($value); } return !empty($col['pill']) ? ucfirst((string) $value) : (string) $value; }; $label = fn ($col) => trim(preg_replace('/\s*\(₦\)\s*$/u', '', $col['label'])); @endphp @push('styles') @endpush @section('body')
@if ($result->stats){{ $result->note }}
@endif @if ($slip) @forelse ($result->rows as $row)Nothing to report for this selection.
@endforelse @if ($result->totals && $result->rows)Amounts in Naira; brackets denote negatives.
@endsection @section('footer') {{ $report::LABEL }} — {{ $company->company_name ?? '' }} @endsection