{{-- Whether the order's invoice is paid, for the order list and the order page. $invoice may be null (an order with no invoice); $balance is what is still owed, when known, and is shown for a partly paid invoice. --}} @php $status = strtolower((string) ($invoice?->status ?? '')); [$fg, $bg] = match ($status) { 'paid' => ['#3c763d', '#dff0d8'], 'partially_paid' => ['#8a6d3b', '#fcf8e3'], 'payment_pending' => ['#31708f', '#d9edf7'], 'unpaid', 'overdue', 'collections' => ['#a94442', '#f2dede'], default => ['#666', '#eee'], }; $label = $invoice ? invoice_status_label($status) : __('admin.orders.no_invoice'); @endphp @if($invoice) {{ $label }} @if($status === 'partially_paid' && isset($balance) && $balance > 0)