@extends('admin.master') @section('content') @include('admin.inventory._styles')
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif @if($errors->any())
@foreach($errors->all() as $error)
{{ $error }}
@endforeach
@endif
← Back

Purchase {{ $purchase->purchase_number }}

Created {{ $purchase->created_at?->format('d M Y, h:i A') }}

@if($purchase->isPending()) ✎ Edit
@csrf
@csrf
@endif

Purchase Summary

{{ ucfirst($purchase->status) }}
Supplier {{ $purchase->supplier?->name }}
{{ $purchase->supplier?->phone }}
Purchase Date {{ $purchase->purchase_date?->format('d M Y') ?: '—' }}
Items / Units {{ $purchase->total_items }} items · {{ $purchase->total_units }} units
Grand Total {{ number_format((float) $purchase->grand_total, 2) }} Tk
Created By {{ $purchase->creator?->name ?: 'System' }}
Received By {{ $purchase->receiver?->name ?: 'Not received' }}
Received At {{ $purchase->received_at?->format('d M Y, h:i A') ?: '—' }}
Note {{ $purchase->note ?: '—' }}

Products

@foreach($purchase->items as $item) @endforeach
Product SKU Unit Cost Quantity Subtotal Stock Before Stock After
@if($item->imageUrl()) {{ $item->product_name }} @else ◇ @endif
{{ $item->product_name }}
{{ $item->variant_name ?: 'Simple product' }}
{{ $item->sku ?: '—' }} {{ number_format((float) $item->unit_cost, 2) }} Tk {{ number_format($item->quantity) }} {{ number_format((float) $item->line_total, 2) }} Tk {{ $item->stock_before ?? '—' }} {{ $item->stock_after ?? '—' }}
Grand Total {{ number_format((float) $purchase->grand_total, 2) }} Tk
@endsection