Purchase Information
@if($purchase->is_credit_purchase) @endif
Invoice No: {{ $purchase->invoice_no }}
Date: {{ $purchase->purchase_date->format('M d, Y h:i A') }}
Reference: {{ $purchase->reference_number ?? 'N/A' }}
Status: {{ ucfirst($purchase->status) }}
Inventory Status: @if($purchase->status == 'completed') Added to Stock @elseif($purchase->status == 'pending') Not Added to Stock @else Cancelled @endif
Credit Purchase: Yes @if($purchase->due_date)
Due: {{ \Carbon\Carbon::parse($purchase->due_date)->format('M d, Y') }} @endif
Supplier Information
@if($purchase->supplier && $purchase->supplier->credit_limit > 0) @endif
Supplier: {{ $purchase->supplier->name ?? 'N/A' }}
Phone: {{ $purchase->supplier->phone ?? 'N/A' }}
Email: {{ $purchase->supplier->email ?? 'N/A' }}
Address: {{ $purchase->supplier->address ?? 'N/A' }}
Credit Limit: KES {{ number_format($purchase->supplier->credit_limit, 2) }} @if($purchase->is_credit_purchase)
Used: KES {{ number_format($purchase->grand_total, 2) }} @endif
Payment Information
Payment Status: {{ ucfirst($purchase->payment_status) }}
Payment Method: {{ ucfirst($purchase->payment_method ?? 'Not specified') }}
Paid Amount: KES {{ number_format($purchase->paid_amount, 2) }}
Balance Due: KES {{ number_format($purchase->grand_total - $purchase->paid_amount, 2) }}
Financial Summary
Subtotal: KES {{ number_format($purchase->subtotal, 2) }}
Tax Amount: KES {{ number_format($purchase->tax_amount, 2) }}
Grand Total: KES {{ number_format($purchase->grand_total, 2) }}
@if($purchase->status == 'pending')
@csrf @method('PUT')
Edit
@csrf @method('PUT')
@if($purchase->items()->where('added_to_stock', false)->count() == $purchase->items()->count())
@csrf @method('DELETE')
@endif @endif @if($purchase->status == 'completed' && $purchase->grand_total > $purchase->paid_amount) Record Payment @endif View Full Details @if($purchase->status == 'cancelled' && $purchase->items()->where('added_to_stock', false)->count() == $purchase->items()->count())
@csrf @method('DELETE')
@endif
Purchase Items
All items are inventory products that affect stock levels when purchase is completed.
@foreach($purchase->items as $item) @endforeach
# Product/Service Type SKU Qty Unit Price Tax % Tax Amount Total Stock Status
{{ $loop->iteration }}
@if($item->item_type == 'product') @else @endif
{{ $item->description ?? ($item->product->name ?? 'Product Deleted') }}
@if($item->item_type == 'product' && $item->product) Stock: {{ $item->product->stock ?? 0 }} @endif @if($item->batch_number) Batch: {{ $item->batch_number }} @endif
{{ ucfirst($item->item_type) }} {{ $item->product->sku ?? ($item->item_type == 'service' ? 'SERVICE' : 'N/A') }} {{ $item->quantity }} KES {{ number_format($item->unit_price, 2) }} {{ number_format($item->tax_percent ?? 0, 2) }}% KES {{ number_format($item->tax_amount ?? 0, 2) }} KES {{ number_format($item->total, 2) }} @if($item->item_type == 'product') @if($item->added_to_stock) Added @else Pending @endif @else N/A @endif
Subtotal: KES {{ number_format($purchase->subtotal, 2) }}
Tax: KES {{ number_format($purchase->tax_amount, 2) }}
Grand Total: KES {{ number_format($purchase->grand_total, 2) }}
Additional Information
@if($purchase->expected_delivery_date) @endif
Created By: {{ $purchase->creator->name ?? 'System' }}
Created At: {{ $purchase->created_at->format('M d, Y h:i A') }}
Expected Delivery: {{ \Carbon\Carbon::parse($purchase->expected_delivery_date)->format('M d, Y') }}
@if($purchase->notes || $purchase->terms_conditions)
Notes & Terms
@if($purchase->notes) Notes:

{{ $purchase->notes }}

@endif @if($purchase->terms_conditions) Terms & Conditions:

{{ $purchase->terms_conditions }}

@endif
@endif
@if($purchase->status == 'completed')
Inventory Status: All {{ $purchase->items->where('item_type', 'product')->count() }} product item(s) have been added to stock. @php $productItems = $purchase->items->where('item_type', 'product'); $totalQuantity = $productItems->sum('quantity'); $totalValue = $productItems->sum(function($item) { return $item->quantity * $item->unit_price; }); @endphp
Stock Added: {{ $totalQuantity }} units worth KES {{ number_format($totalValue, 2) }}
@elseif($purchase->status == 'pending')
Inventory Status: Purchase is pending. Product items will be added to stock when marked as completed. @php $productItems = $purchase->items->where('item_type', 'product'); $totalQuantity = $productItems->sum('quantity'); @endphp
Pending Stock: {{ $totalQuantity }} units awaiting addition to inventory
@endif