@extends('layouts.supervisor') @section('title', 'Monitoring Purchases - Supervisor') @section('content') @php $totalPurchases = $purchases->total(); $approvedCount = $purchases->filter(fn($p) => $p->status === 'approved')->count(); $pendingCount = $purchases->filter(fn($p) => $p->status === 'pending')->count(); $totalAmount = $purchases->sum('total_amount'); @endphp

Monitoring Pembelian

Pantau semua pembelian bahan dan sparepart

Total Pembelian

{{ $totalPurchases }}

Disetujui

{{ $approvedCount }}

Menunggu

{{ $pendingCount }}

Total Nilai

Rp {{ number_format($totalAmount, 0, ',', '.') }}

Data Pembelian

{{ $totalPurchases }} pembelian
@forelse($purchases as $purchase) @empty @endforelse
Tanggal Kode Supplier Tipe Total Status
{{ $purchase->purchase_date ? $purchase->purchase_date->format('d M Y') : '-' }}
@if($purchase->purchase_date)
{{ $purchase->purchase_date->diffForHumans() }}
@endif
{{ $purchase->purchase_code ?? '#' . $purchase->id }}
{{ Str::limit($purchase->supplier_name ?? '-', 25) }}
{{ ucfirst($purchase->purchase_type ?? '-') }} Rp {{ number_format($purchase->total_amount, 0, ',', '.') }} {{ ucfirst($purchase->status ?? '-') }}

Tidak Ada Data Pembelian

Belum ada pembelian yang tercatat

@if($purchases->hasPages())
{{ $purchases->links() }}
@endif
@endsection