@extends('admin.master') @section('content') @include('admin.inventory._styles')
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif

Purchases

Record stock received from suppliers and keep inventory synchronized.

+ Add Purchase
Purchases {{ $purchases->total() }} items
@if($term !== '' || $status !== '') Reset @endif
@foreach($purchases as $purchase) @php $firstItem = $purchase->items->first(); $firstImage = $firstItem?->imageUrl(); @endphp @endforeach @if($purchases->isEmpty()) @endif
Product Images Supplier Status Created Grand Total Note Actions
{{ $firstItem?->product_name ?: 'No product' }} @if($purchase->items->count() > 1) +{{ $purchase->items->count() - 1 }} @endif
{{ $purchase->purchase_number }} · {{ number_format($purchase->total_units) }} units
@if($firstImage) Product @else ◇ @endif
{{ $purchase->supplier?->name ?: 'Unknown supplier' }}
{{ $purchase->supplier?->phone }}
{{ ucfirst($purchase->status) }}
{{ $purchase->creator?->name ?: 'System' }}
{{ $purchase->created_at?->format('d M Y, h:i A') }}
{{ number_format((float) $purchase->grand_total, 2) }} Tk {{ \Illuminate\Support\Str::limit($purchase->note ?: '—', 45) }}
@if($purchase->isPending())
@csrf @method('DELETE')
@endif
No purchases found Add a purchase to record incoming stock.
@if($purchases->hasPages())
{{ $purchases->links() }}
@endif
@endsection