@extends('layouts.admin') @section('title', trans('admin.tenant_show_title', ['name' => $tenant->name])) @section('header_title', trans('admin.tenant_show_header', ['name' => $tenant->name])) @section('content')
← {{ trans('admin.back_to_tenants') }}

{{ $tenant->name }}

@if($tenant->name_en) ({{ $tenant->name_en }}) @endif @if($tenant->is_active) {{ trans('admin.active') }} @else {{ trans('admin.inactive') }} @endif {{ $tenant->is_sandbox ? 'Sandbox' : 'Production Live' }}
{{ trans('admin.vat_label') }} {{ $tenant->vat_number }}
@if($tenant->cr_number)
{{ trans('admin.cr_label') }} {{ $tenant->cr_number }}
@endif
{{ trans('admin.email_label') }} {{ $tenant->email }}
@if($tenant->phone)
{{ trans('admin.phone_label') }} {{ $tenant->phone }}
@endif
{{ trans('admin.registered_at') }} {{ $tenant->created_at->format('Y-m-d') }}
@csrf
@csrf
@csrf
{{ trans('admin.current_plan_badge') }} {{ $tenant->plan }}
{{ trans('admin.invoice_consumption') }} {{ $tenant->invoices_used_this_month }} / {{ $tenant->monthly_invoice_limit }}
{{ trans('admin.cleared_invoices_zatca') }} {{ $invoiceStats['cleared'] + $invoiceStats['reported'] }}
{{ trans('admin.pos_devices') }} {{ $tenant->devices_count }}
{{ trans('admin.total_sales_volume') }} {{ number_format($invoiceStats['total_sar'], 2) }} ﷼

{{ trans('admin.edit_plan_heading') }}

@csrf @method('PUT')
{{ trans('admin.invoices_heading') }} ({{ count($recentInvoices) }}) {{ number_format($invoiceStats['total_sar'], 2) }} ﷼
@forelse($recentInvoices as $inv) @empty @endforelse
{{ trans('dashboard.invoice_number') }} {{ trans('admin.th_type') }} {{ trans('admin.th_customer') }} {{ trans('admin.th_total_amount') }} {{ trans('admin.th_tax') }} {{ trans('dashboard.status_in_zatca') }} {{ trans('admin.th_issue_date') }}
{{ $inv->invoice_number }} {{ $inv->type?->clientLabel() ?? trans('admin.default_invoice_type') }} {{ $inv->customer_name ?? '-' }} {{ number_format($inv->total, 2) }} ﷼ {{ number_format($inv->tax_amount, 2) }} ﷼ @if($inv->status->value === 'cleared') {{ trans('dashboard.cleared_badge') }} @elseif($inv->status->value === 'reported') {{ trans('dashboard.reported_badge') }} @elseif($inv->status->value === 'rejected' || $inv->status->value === 'failed') {{ $inv->status->label() }} @else {{ $inv->status->label() }} @endif {{ $inv->issued_at ? $inv->issued_at->format('Y-m-d H:i') : $inv->created_at->format('Y-m-d H:i') }}
{{ trans('admin.no_invoices') }}
{{ trans('admin.pos_devices_heading') }} ({{ $tenant->devices->count() }})
@forelse($tenant->devices as $d) @empty @endforelse
{{ trans('admin.th_device_name') }} {{ trans('admin.th_serial_number') }} {{ trans('admin.th_csid_status') }} {{ trans('admin.th_registration_date') }}
{{ $d->name }} {{ $d->serial_number }} {{ $d->onboarding_status }} {{ $d->created_at->format('Y-m-d H:i') }}
{{ trans('admin.no_devices') }}
{{ trans('admin.api_keys_heading') }} ({{ $tenant->apiKeys->count() }})
@forelse($tenant->apiKeys as $k) @empty @endforelse
{{ trans('admin.th_key_name') }} {{ trans('admin.th_prefix') }} {{ trans('admin.th_requests_count') }} {{ trans('admin.th_created_at') }}
{{ $k->name }} {{ $k->key_prefix }}... {{ number_format($k->requests_count) }} {{ $k->created_at->format('Y-m-d') }}
{{ trans('admin.no_keys') }}
{{ trans('admin.users_heading') }} ({{ $tenant->users->count() }})
@forelse($tenant->users as $u) @empty @endforelse
{{ trans('admin.th_user_name') }} {{ trans('admin.th_user_email') }} {{ trans('admin.th_user_role') }} {{ trans('admin.th_joined_date') }}
{{ $u->name }} {{ $u->email }} {{ $u->role ?? 'member' }} {{ $u->created_at->format('Y-m-d') }}
{{ trans('admin.no_users') }}

{{ trans('admin.client_activity_timeline') }}

@forelse($clientActions as $action)
{{ $action['icon'] }}
{{ $action['title'] }} {{ $action['timestamp'] ? $action['timestamp']->diffForHumans() : '' }}
{{ $action['subtitle'] }}
@empty
{{ trans('admin.no_client_activities') }}
@endforelse
@endsection