@extends('procurement::layouts.master') @section('title','Dashboard') @section('content')

Procurement Dashboard

{{ now()->format('l, F j, Y') }}
Total Spend (All Time)
${{ number_format($totalSpend, 2) }}
Unpaid Invoices
${{ number_format($unpaidTotal, 2) }}
@if($overdueInvoices > 0)
{{ $overdueInvoices }} overdue
@endif
Open Orders
{{ $openOrders }}
@if($overdueOrders > 0)
{{ $overdueOrders }} overdue delivery
@endif
Low Stock Alerts
{{ $lowStockItems->count() }}
{{ $componentCount }} components tracked
Active Projects
View All
@forelse($activeProjects as $project)
{{ $project->name }} {{ ucfirst(str_replace('_',' ',$project->status)) }}
{{ $project->runs_count }} run(s)
@if($project->target_launch_date) Launch: {{ $project->target_launch_date->format('M j, Y') }} @endif
@empty
No active projects
@endforelse @if($activeRuns->count())
In-Progress Runs
@foreach($activeRuns as $run) @endforeach
@endif
Top Spend by Supplier
@forelse($spendBySupplier as $name => $amount)
{{ $name ?? 'Unknown' }} ${{ number_format($amount, 2) }}
@empty
No spend data yet
@endforelse
⚠ Long Lead Items (≥8 wk)
@forelse($longLeadItems as $c) @empty @endforelse
{{ $c->ref_designator }}
{{ Str::limit($c->description,35) }}
{{ $c->lead_time_weeks }}w
None flagged
@if($lowStockItems->count())
⚠ Low Stock
@foreach($lowStockItems as $s) @endforeach
{{ Str::limit($s->component->description,30) }} {{ $s->qty_on_hand }} on hand
@endif
Recent Invoices
+ New Invoice
@forelse($recentInvoices as $inv) @empty @endforelse
Invoice #SupplierPODateDueStatusAmount (USD)
{{ $inv->invoice_number }} {{ $inv->supplier->name ?? '—' }} {{ $inv->purchaseOrder->po_number ?? '—' }} {{ $inv->invoice_date->format('M j, Y') }} {{ $inv->due_date?->format('M j, Y') ?? '—' }} {{ ucfirst($inv->status) }} ${{ number_format($inv->amount_usd, 2) }}
No invoices yet
@endsection