@extends('layouts.admin') @section('title', $tenant->business_name ?? 'Business Details') @push('styles') @endpush @section('content')

Business Details

Name {{ $tenant->name }}
Business Name {{ $tenant->business_name }}
Email {{ $tenant->business_email ?? '—' }}
Phone {{ $tenant->business_phone ?? '—' }}
Slug /{{ $tenant->slug }}
Status {{ ucfirst($tenant->status ?? 'active') }}
Created {{ $tenant->created_at?->format('M d, Y') ?? '—' }}

Owner

@if($tenant->user)
Email {{ $tenant->user->email }}
@else

No owner linked.

@endif

Usage

{{-- $usage is computed by InventoryAdminController::showTenant via $tenant->products()->count() — i.e. the live count from the products table. $tenant->products_count would only exist if the controller called withCount() (it doesn't), which was why every tenant page showed 0. --}}
{{ $usage['products'] ?? 0 }}
Products
{{ $tenant->max_products ?? 50 }}
Max Products
{{ $usage['staff'] ?? 0 }}
Staff
{{ $tenant->max_staff ?? 3 }}
Max Staff
{{-- Secondary row: orders this month + total customers, so the admin gets a quick read of activity without leaving the page. --}}
{{ $usage['orders_month'] ?? 0 }}
Orders This Month
{{ $usage['customers'] ?? 0 }}
Customers

Plan & Billing

Current Plan {{ ($currentPlan->name ?? null) ? $currentPlan->name : ucfirst($tenant->plan ?? 'free') }}
Status {{ ucfirst($tenant->status ?? '—') }}
Renews / expires {{ $tenant->subscription_ends_at ? \Carbon\Carbon::parse($tenant->subscription_ends_at)->format('M d, Y') : '—' }}
Usage {{ $usage['products'] ?? 0 }} / {{ $tenant->max_products ?? 0 }} products · {{ $usage['staff'] ?? 0 }} / {{ $tenant->max_staff ?? 0 }} staff · {{ $usage['orders_month'] ?? 0 }} orders this month
{{-- Complimentary plan override (super-admin only) --}} @if(auth()->user() && auth()->user()->role === 'super_admin')

Grant Complimentary Plan

Instantly activates a plan at no charge — for manual payments, comped accounts, or one-off support. The tenant owner is emailed (PDF invoice attached) and the billing history below shows the grant as Complimentary.

@endif

Billing History

@if($invoices->isEmpty())

No billing history yet.

@else
@foreach($invoices as $inv) @php $isComp = ($inv->gateway ?? '') === 'admin_override'; @endphp @endforeach
Date Plan Cycle Amount Status Source Reference Invoice
{{ \Carbon\Carbon::parse($inv->created_at)->format('M d, Y') }} {{ optional($inv->plan)->name ?? '—' }} {{ ucfirst($inv->billing_cycle ?? 'monthly') }} @if($isComp) Complimentary @else ₦{{ number_format((float) $inv->amount, 2) }} @endif {{ ucfirst($inv->status ?? '—') }} {{ $isComp ? 'Admin override' : ucfirst($inv->gateway ?? '—') }} {{ $inv->reference }} @if(($inv->status ?? '') === 'completed') PDF @else @endif
@endif
@endsection