@include('purchase::partials.styles')

{{ $pr->pr_number }} {{ $pr->status }}

@if($pr->canEdit()) ✏️ Edit @endif @if($pr->canSubmit())
@csrf
@endif @if($pr->canApprove()) @can('purchase.purchase-requests.approve')
@csrf
@endcan @endif @if($pr->status === 'APPROVED') 🛒 Create PO @endif @if($pr->canCancel())
@csrf
@endif
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif @if($pr->rejection_reason)
Rejection Reason: {{ $pr->rejection_reason }}
@endif
📋 Request Details
PR Number
{{ $pr->pr_number }}
PR Date
{{ $pr->pr_date->format('d M Y') }}
Required By
{{ $pr->required_date?->format('d M Y') ?? '-' }}
Priority
{{ $pr->priority }}
Status
{{ $pr->status }}
📝 Request Info
Department
{{ $pr->department ?? '-' }}
Purpose
{{ $pr->purpose ?? '-' }}
Requested By
{{ $pr->requester->name ?? '-' }}
@if($pr->approver)
{{ $pr->status === 'REJECTED' ? 'Rejected' : 'Approved' }} By
{{ $pr->approver->name }}
{{ $pr->status === 'REJECTED' ? 'Rejected' : 'Approved' }} At
{{ $pr->approved_at?->format('d M Y, h:i A') ?? '-' }}
@endif
📦 Request Items
@php $grandTotal = 0; @endphp @forelse($pr->items as $idx => $item) @php $lineTotal = $item->qty * ($item->estimated_price ?? 0); $grandTotal += $lineTotal; $imageUrl = null; if ($item->variation && $item->variation->image_path) { $imageUrl = asset('storage/' . $item->variation->image_path); } elseif ($item->product && $item->product->primaryImage) { $imageUrl = asset('storage/' . $item->product->primaryImage->image_path); } @endphp @empty @endforelse
# Product Unit Qty Ordered Pending Est. Price Est. Total
{{ $idx + 1 }}
@if($imageUrl) @else
@endif
{{ $item->product->name ?? 'N/A' }}
@if($item->variation) {{ $item->variation->variation_name ?: $item->variation->sku }} @endif @if($item->product?->sku)SKU: {{ $item->product->sku }}@endif
{{ $item->unit->short_name ?? $item->unit->name ?? '-' }} {{ number_format($item->qty, 3) }} {{ number_format($item->ordered_qty, 3) }} {{ number_format($item->pending_qty, 3) }} ₹{{ number_format($item->estimated_price ?? 0, 2) }} ₹{{ number_format($lineTotal, 2) }}
No items found
Estimated Total: ₹{{ number_format($grandTotal, 2) }}
@if($pr->notes)
📝 Notes

{{ $pr->notes }}

@endif
🕐 Audit Information
Created At
{{ $pr->created_at->format('d M Y, h:i A') }}
Updated At
{{ $pr->updated_at->format('d M Y, h:i A') }}