@extends('layouts.app') @section('title', 'Suppliers') @section('content') {{-- ── Page Header ─────────────────────────────────────────────────────────── --}} {{-- ── Stat Cards ───────────────────────────────────────────────────────────── --}}
{{ $stats['total'] }}
Total Suppliers
{{ $stats['active'] }}
Active
{{ $stats['inactive'] }}
Inactive
{{ $stats['categories'] }}
Categories
{{-- ── Search + Count bar ───────────────────────────────────────────────────── --}}
{{ $stats['total'] }} suppliers
{{-- ── Table ────────────────────────────────────────────────────────────────── --}}
@forelse($suppliers as $i => $supplier) {{-- Code --}} {{-- Company + website --}} {{-- Category --}} {{-- Contact person + emails stacked --}} {{-- Phones stacked --}} {{-- Address --}} {{-- Tax + Credit stacked --}} {{-- Status --}} @empty @endforelse
Code Company Category Contact & Email Phone / WhatsApp Address Tax / Credit Status
{{ $supplier->supplier_code ?: '—' }}
{{ $supplier->name }}
@if($supplier->website) {{ parse_url($supplier->website, PHP_URL_HOST) ?: $supplier->website }} @endif
@if($supplier->category) {{ $supplier->category }} @else @endif @if($supplier->contact_person)
{{ $supplier->contact_person }}
@endif @if($supplier->email) {{ $supplier->email }} @endif @if($supplier->secondary_email) {{ $supplier->secondary_email }} @endif @if(!$supplier->contact_person && !$supplier->email) @endif
@if($supplier->phone) {{ $supplier->phone }} @endif @if($supplier->phone2) {{ $supplier->phone2 }} @endif @if($supplier->whatsapp) {{ $supplier->whatsapp }} @endif @if(!$supplier->phone && !$supplier->phone2 && !$supplier->whatsapp) @endif {{ $supplier->address ?: '—' }} @if($supplier->tax_number)
{{ $supplier->tax_number }}
@endif @if(in_array(strtolower($supplier->credit_terms ?? ''), ['y','yes']))
Credit{{ $supplier->credit_days ? ' · '.$supplier->credit_days.'d' : '' }}
@elseif(!$supplier->tax_number) @endif
@if($supplier->is_active) Active @else Inactive @endif
No suppliers found.
{{-- No-results message (shown by JS) --}} {{-- ═══════════ Row Context Dropdown ═══════════ --}} {{-- ═══════════ Supplier View / Edit Modal ═══════════ --}} @foreach($categories as $cat) {{-- ═══════════ Delete Confirmation Modal ═══════════ --}} {{-- ═══════════ Import Modal ═══════════ --}} @endsection