@extends('layouts.app') @section('title','Purchase Request') @section('page-title','Purchase Request Detail') @section('content')
Back
@if($purchaseRequest->status==='pending' && auth()->user()->hasAnyRole(['ceo','super_admin','project_manager','administration'])) Edit
@csrf
@csrf
@endif {{ ucfirst($purchaseRequest->status) }}
Request Details
PR Number
{{ $purchaseRequest->pr_number }}
Item
{{ $purchaseRequest->item_description }}
Quantity
{{ $purchaseRequest->quantity }} {{ $purchaseRequest->unit }}
Est. Cost
{{ $purchaseRequest->estimated_cost ? 'GH₵ '.number_format($purchaseRequest->estimated_cost,2) : '—' }}
Urgency
{{ $purchaseRequest->urgency }}
Project
{{ $purchaseRequest->project->name ?? '—' }}
Requested By
{{ $purchaseRequest->requester->name ?? '—' }}
Date
{{ $purchaseRequest->created_at->format('d M Y H:i') }}
@if($purchaseRequest->approved_by)
{{ ucfirst($purchaseRequest->status) }} By
{{ $purchaseRequest->approved_by }} on {{ $purchaseRequest->approved_date?->format('d M Y') }}
@endif @if($purchaseRequest->justification)
Justification
{{ $purchaseRequest->justification }}
@endif
{{-- Attachments Panel --}}
Invoice Attachments {{ $purchaseRequest->invoices()->count() }}
@if($purchaseRequest->invoices()->count() === 0)
No invoices attached.
@else @if($purchaseRequest->attachment_notes)
{{ $purchaseRequest->attachment_notes }}
@endif
@foreach(['invoice_1','invoice_2','invoice_3','invoice_4','invoice_5'] as $i => $field) @if($purchaseRequest->$field) @php $path = $purchaseRequest->$field; $ext = strtolower(pathinfo($path, PATHINFO_EXTENSION)); $isPdf = $ext === 'pdf'; $url = Storage::url($path); @endphp
Invoice / Quote #{{ $i+1 }}
{{ $ext }}
@if(!$isPdf) Invoice {{ $i+1 }} @endif @endif @endforeach
@endif
@endsection