@extends('layouts.app')
@section('title', 'Suppliers')
@section('page', 'suppliers')
@php
$statusVariant = fn ($s) => $s === 'Active' ? 'success' : 'danger';
$toneCycle = ['primary', 'success', 'warning', 'info', 'danger'];
$totalSuppliers = $suppliers->count();
$activeSuppliers = $suppliers->where('status', 'Active')->count();
$inactiveSuppliers = $suppliers->where('status', 'Inactive')->count();
$totalOutstanding = $suppliers->sum(fn ($s) => (float) $s->outstanding_amount);
@endphp
@section('content')
@if (session('success'))
Total Suppliers {{ $totalSuppliers }} Active {{ $activeSuppliers }} Inactive {{ $inactiveSuppliers }} Total Outstanding {{ number_format($totalOutstanding, 2) }}
@empty
{{ $row->name }}
{{ $row->address ?: '—' }}
{{ $row->phone ?: '—' }}
{{ number_format((float) $row->outstanding_amount, 2) }}
@endforelse
No suppliers yet. Add your first supplier.