{{-- Search Bar --}}
@foreach($machines as $m) @endforeach
{{-- 開始時間 --}}
{{ __('Start Time') }}
{{-- 結束時間 --}}
{{ __('End Time') }}
@if($isImplicitFilter)
{{ __('Showing last 6 months by default when no date range is selected') }}
@endif {{-- Table (Desktop) --}} {{-- Mobile Cards (xl:hidden) --}}
@forelse($invoices as $invoice)
@php $st = $invoice->status ?: (empty($invoice->invoice_no) ? 'failed' : 'issued'); $statusMap = [ 'pending' => ['label' => __('Pending'), 'color' => 'amber'], 'issued' => ['label' => __('Issued'), 'color' => 'emerald'], 'failed' => ['label' => __('Failed'), 'color' => 'rose'], 'void' => ['label' => __('Void'), 'color' => 'slate'], ]; $s = $statusMap[$st] ?? ['label' => $st, 'color' => 'slate']; @endphp {{-- Card Header --}}

{{ $invoice->invoice_no }}

{{ $invoice->invoice_date }}

{{ ($invoice->machine_time ?? $invoice->created_at)->format('Y-m-d H:i:s') }}

{{-- Info Grid --}}

{{ __('Machine') }}

{{ $invoice->machine->name ?? ($invoice->order->machine->name ?? 'Unknown') }}

{{ $invoice->machine->serial_no ?? ($invoice->order->machine->serial_no ?? '---') }}

{{ __('Amount') }}

${{ number_format($invoice->amount, 0) }}

{{ __('Associated Order') }}

{{ $invoice->order->order_no ?? '---' }}

{{ __('Machine Time') }}

{{ ($invoice->machine_time ?? $invoice->created_at)->format('Y-m-d H:i:s') }}

{{-- Remark --}}

{{ __('Remark') }}

{{-- Action Buttons --}}
@if(in_array($st, ['pending', 'failed']))
@csrf
@csrf
@endif @if($st === 'issued' && auth()->user()->isSystemAdmin())
@csrf
@endif
@empty
@endforelse
{{-- Pagination --}}
{{ $invoices->links('vendor.pagination.luxury', ['page_param' => 'invoices_page']) }}