<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Expense Voucher {{ $expense->expense_number }}</title>
<style>body{font-family:Arial,sans-serif;color:#111827;margin:0;background:#f3f4f6}.actions{max-width:780px;margin:16px auto;display:flex;gap:8px}.btn{padding:8px 12px;border:1px solid #d1d5db;background:#fff;color:#111827;text-decoration:none;cursor:pointer}.sheet{max-width:780px;margin:0 auto 24px;background:#fff;padding:30px;border:1px solid #d1d5db}.head{display:flex;justify-content:space-between;gap:20px;border-bottom:2px solid #111827;padding-bottom:16px}.brand{display:flex;gap:12px}.logo{max-width:80px;max-height:65px;object-fit:contain}.name{font-size:20px;font-weight:700}.muted{font-size:11px;color:#6b7280;line-height:1.5}.title{text-align:right;font-size:18px;font-weight:700}.grid{display:grid;grid-template-columns:1fr 1fr;gap:15px 25px;margin-top:22px}.label{font-size:10px;text-transform:uppercase;color:#6b7280}.value{font-size:14px;font-weight:600;margin-top:3px}.amount{margin:24px 0;padding:16px;border:1px solid #d1d5db;text-align:center}.amount strong{font-size:25px}.signatures{display:grid;grid-template-columns:1fr 1fr;gap:50px;margin-top:55px}.sig{border-top:1px solid #111827;padding-top:6px;font-size:11px}.stamp{max-width:110px;max-height:80px;object-fit:contain}@media print{body{background:#fff}.actions{display:none}.sheet{border:0;margin:0;max-width:none}}</style></head><body>
@php($business=$expense->branch->business)
<div class="actions"><button class="btn" onclick="window.print()">Print Voucher</button><a class="btn" href="{{ route('documents.expense-voucher.pdf',$expense) }}">Download PDF</a><a class="btn" href="{{ route('expenses.show',$expense) }}">Back to Expense</a></div>
<main class="sheet"><div class="head"><div class="brand">@if($business->logo_path)<img class="logo" src="{{ route('document-branding.asset',[$business,'logo']) }}" alt="Company logo">@endif<div><div class="name">{{ $business->name }}</div><div class="muted">{{ collect([$business->address,$business->district,$business->region,$business->country])->filter()->join(', ') }}<br>{{ collect([$business->phone,$business->email,$business->website])->filter()->join(' · ') }}<br>Reg: {{ $business->registration_number ?: 'N/A' }} · TIN: {{ $business->tin ?: 'N/A' }}</div></div></div><div class="title">EXPENSE VOUCHER<div class="muted">{{ $expense->expense_number }}<br>{{ $expense->expense_date->format('d M Y') }}</div></div></div>
<div class="grid"><div><div class="label">Branch</div><div class="value">{{ $expense->branch->name }}</div></div><div><div class="label">Category</div><div class="value">{{ $expense->category->name }}</div></div><div><div class="label">Supplier / Payee</div><div class="value">{{ $expense->supplier ?: 'N/A' }}</div></div><div><div class="label">Paid From</div><div class="value">{{ $expense->financialAccount->name }}</div></div><div style="grid-column:1/-1"><div class="label">Description</div><div class="value">{{ $expense->description }}</div></div><div><div class="label">Account Transaction</div><div class="value">{{ $expense->accountTransaction?->transaction_number ?: 'N/A' }}</div></div><div><div class="label">Accounting Journal</div><div class="value">{{ $expense->accounting_journal_number ?: 'N/A' }}</div></div><div><div class="label">Entered By</div><div class="value">{{ $expense->enteredBy?->name ?: 'N/A' }}</div></div><div><div class="label">Approved By / At</div><div class="value">{{ $expense->approver?->name ?: 'N/A' }} · {{ $expense->approved_at?->format('d M Y H:i') }}</div></div></div>
<div class="amount"><div class="label">Amount</div><strong>{{ $business->currency_symbol ?: $business->currency }} {{ number_format((float)$expense->amount,2) }}</strong></div>
@if($expense->notes || $expense->decision_comments)<div class="grid"><div><div class="label">Notes</div><div class="value">{{ $expense->notes ?: 'None' }}</div></div><div><div class="label">Approval Comments</div><div class="value">{{ $expense->decision_comments ?: 'None' }}</div></div></div>@endif
<div class="signatures"><div class="sig">Prepared By / Date</div><div class="sig">Approved By / Date</div><div class="sig">Payee Signature / Date</div><div>@if($business->stamp_path)<img class="stamp" src="{{ route('document-branding.asset',[$business,'stamp']) }}" alt="Company stamp">@else<div class="sig">Company Stamp</div>@endif</div></div>
</main></body></html>
