@extends('layouts.dashboard') @php $isCreditNote = $type === 'credit_note'; $isDebitNote = $type === 'debit_note'; $isNote = $isCreditNote || $isDebitNote; $pageTitle = match($type) { 'credit_note' => trans('dashboard.credit_notes_title'), 'debit_note' => trans('dashboard.debit_notes_title'), default => trans('dashboard.invoices_title'), }; $headerTitle = match($type) { 'credit_note' => trans('dashboard.credit_notes_header'), 'debit_note' => trans('dashboard.debit_notes_header'), default => trans('dashboard.invoices_header'), }; @endphp @section('title', $pageTitle) @section('header_title', $headerTitle) @section('content')
{{-- Sandbox / Test Mode Banner --}} @if(! $tenant->zatcaEnvironment()->isLive())
๐Ÿงช

{{ trans('dashboard.sandbox_mode_title') }}

{{ trans('dashboard.sandbox_mode_desc') }}

@endif
@if($type) @endif
@if(request()->hasAny(['search', 'status'])) {{ trans('dashboard.clear_filter') }} @endif
@if($isNote) {{-- Credit & Debit Notes Dedicated Columns --}} @forelse($invoices as $inv) @empty @endforelse @else {{-- Standard Invoices Columns --}} @forelse($invoices as $inv) @empty @endforelse @endif
{{ trans('dashboard.th_note_number') }} {{ trans('dashboard.th_original_invoice') }} {{ trans('dashboard.client') }} {{ trans('dashboard.th_reason') }} {{ trans('dashboard.total_amount') }} {{ trans('dashboard.status_in_zatca') }} {{ trans('dashboard.th_actions') }}
{{ $inv->invoice_number }} @if($inv->originalInvoice) {{ $inv->originalInvoice->invoice_number }} @else โ€” @endif {{ $inv->buyer_name }} {{ $inv->reason ?: 'โ€”' }} {{ $isCreditNote ? '-' : '+' }}{{ number_format($inv->total, 2) }} @if($inv->status->value === 'cleared') {{ trans('dashboard.status_accepted') }} @elseif($inv->status->value === 'reported') {{ trans('dashboard.status_accepted_reported') }} @elseif($inv->status->value === 'rejected') {{ trans('dashboard.status_rejected') }} @else {{ $inv->status->label() }} @endif
PDF @if($inv->signed_xml) XML @endif

{{ trans('dashboard.no_notes_found_title') }}

{{ $isDebitNote ? trans('dashboard.no_debit_notes_desc') : trans('dashboard.no_credit_notes_desc') }}

{{ trans('dashboard.create_note_action') }}
{{ trans('dashboard.th_invoice_number') }} {{ trans('dashboard.th_type') }} {{ trans('dashboard.th_issued_at') }} {{ trans('dashboard.th_buyer') }} {{ trans('dashboard.th_subtotal') }} {{ trans('dashboard.th_vat') }} {{ trans('dashboard.th_total') }} {{ trans('dashboard.th_zatca_status') }} {{ trans('dashboard.th_download') }}
{{ $inv->invoice_number }} {{ match($inv->type) { 'standard' => trans('dashboard.type_standard'), 'credit_note' => trans('dashboard.action_credit_note'), 'debit_note' => trans('dashboard.action_debit_note'), default => trans('dashboard.type_simplified'), } }} {{ $inv->issued_at?->format('Y-m-d H:i') }} {{ $inv->buyer_name }} {{ number_format($inv->subtotal, 2) }} {{ number_format($inv->vat_amount, 2) }} {{ number_format($inv->total, 2) }} @if($inv->status->value === 'cleared') {{ trans('dashboard.badge_cleared') }} @elseif($inv->status->value === 'reported') {{ trans('dashboard.badge_reported') }} @elseif($inv->status->value === 'rejected') {{ trans('dashboard.badge_rejected') }} @else {{ $inv->status->label() }} @endif
PDF @if($inv->signed_xml) XML @endif
{{ trans('dashboard.no_invoices_found') }}
@if($invoices->hasPages())
{{ $invoices->links() }}
@endif
@endsection