{{-- ══ COVER ══════════════════════════════════════════════════════════════════ --}}

AUDIT DOSSIER

{{ $procurement->title }}

{{ $procurement->reference }} • {{ strtoupper($procurement->method) }} • {{ $procurement->type }}

Compliance Score: {{ $complianceScore }}%

 

Generated: {{ now()->format('d M Y H:i') }}

{{-- ══ §1 PROCUREMENT OVERVIEW ════════════════════════════════════════════════ --}}

§1 Procurement Overview

Reference{{ $procurement->reference }}
Title{{ $procurement->title }}
Method{{ $procurement->method }}
Type{{ $procurement->type }}
Status{{ ucfirst($procurement->status) }}
Stage{{ $procurement->current_stage }} — {{ $procurement->stage_label }}
Estimated Value{{ $procurement->currency }} {{ number_format($procurement->estimated_value, 2) }}
Budget Line{{ $procurement->budget_line ?? '—' }}
Planned Close{{ $procurement->planned_close_date?->format('d M Y') ?? '—' }}
Actual Close{{ $procurement->actual_close_date?->format('d M Y') ?? '—' }}
Variance{{ $procurement->variance_days !== null ? $procurement->variance_days . ' days' : '—' }}
Audit Locked{{ $procurement->audit_locked ? 'Yes (VC-5)' : 'No' }}
@if($procurement->description)

Description: {{ $procurement->description }}

@endif {{-- ══ §2 COMPLIANCE GAPS ══════════════════════════════════════════════════════ --}}

§2 Compliance Gaps ({{ count($gaps) }})

@if(count($gaps) === 0)

No compliance gaps detected.

@else @foreach($gaps as $gap)
{{ strtoupper($gap['severity']) }}: {{ $gap['message'] }}
@endforeach @endif {{-- ══ §3 DOCUMENTS ════════════════════════════════════════════════════════════ --}}

§3 Document Register ({{ $procurement->documents->count() }})

@forelse($procurement->documents as $i => $doc) @empty @endforelse
#NameCategory / TypeVersionUploaded ByDateStatus
{{ $i+1 }} {{ $doc->name }} {{ $doc->category ?? $doc->type ?? '—' }} {{ $doc->version ?? '1.0' }} {{ $doc->uploader->name ?? '—' }} {{ $doc->created_at->format('d M Y') }} {{ $doc->is_locked ? 'Locked' : 'Draft' }}
No documents uploaded.
{{-- ══ §4 BIDS ══════════════════════════════════════════════════════════════════ --}}

§4 Bids Received ({{ $procurement->bids->count() }})

@forelse($procurement->bids as $i => $bid) @empty @endforelse
#SupplierReferenceValueSubmittedStatus
{{ $i+1 }} {{ $bid->supplier->name ?? '—' }} {{ $bid->reference ?? '—' }} {{ $bid->currency }} {{ number_format($bid->amount ?? 0, 2) }} {{ $bid->submitted_at ? $bid->submitted_at->format('d M Y') : '—' }} {{ ucfirst($bid->status ?? 'pending') }}
No bids recorded.
{{-- ══ §5 EVALUATIONS ══════════════════════════════════════════════════════════ --}}

§5 Evaluation Records ({{ $procurement->evaluations->count() }})

@forelse($procurement->evaluations as $eval)

Evaluator: {{ $eval->evaluator->name ?? '—' }} ({{ $eval->evaluator_role }})

COI SignedStatusSubmitted AtLocked
{{ $eval->coi_signed ? 'Yes — '.$eval->coi_signed_at?->format('d M Y') : 'No' }} {{ ucfirst($eval->status) }} {{ $eval->submitted_at?->format('d M Y H:i') ?? '—' }} {{ $eval->is_locked ? 'Yes (VC-1)' : 'No' }}
@if($eval->scores->isNotEmpty()) @foreach($eval->scores as $sc) @endforeach
CriterionWeight %ScoreJustification
{{ $sc->criterion }} {{ $sc->weight }}% {{ $sc->score }} {{ $sc->justification ?? '—' }}
@endif @empty

No evaluations recorded.

@endforelse {{-- ══ §6 APPROVALS ════════════════════════════════════════════════════════════ --}}

§6 Approval Chain ({{ $procurement->approvals->count() }})

@forelse($procurement->approvals->sortBy('order') as $ap) @empty @endforelse
#ApproverRoleTypeStageStatusCommentDecided
{{ $ap->order }} {{ $ap->approver->name ?? '—' }} {{ $ap->role_label }} {{ ucfirst($ap->approval_type ?? 'general') }} {{ $ap->stage }} {{ ucfirst($ap->status) }} {{ $ap->comment ?? '—' }} {{ $ap->decided_at?->format('d M Y') ?? '—' }}
No approvals recorded.
{{-- ══ §7 CONTRACT ══════════════════════════════════════════════════════════════ --}}

§7 Contract Details

@forelse($procurement->contracts as $contract)
Contract No.{{ $contract->contract_number }}Supplier{{ $contract->supplier->name ?? '—' }}
Value{{ $contract->currency }} {{ number_format($contract->contract_value, 2) }}Type{{ $contract->contract_type ?? '—' }}
Signed{{ $contract->signed_at?->format('d M Y') ?? '—' }}Status{{ ucfirst($contract->status) }}
Start{{ $contract->start_date?->format('d M Y') ?? '—' }}End{{ $contract->end_date?->format('d M Y') ?? '—' }}
Registered{{ $contract->registered_at ? $contract->registered_at->format('d M Y').' (VC-4)' : 'No' }}Frozen{{ $contract->is_frozen ? 'Yes (VC-3)' : 'No' }}
Handover{{ $contract->handover_confirmed ? 'Yes — '.$contract->handover_dept : 'Not yet' }}Reg. Ref.{{ $contract->registration_reference ?? '—' }}
@if($contract->versions->isNotEmpty())

Contract Versions

@foreach($contract->versions as $v) @endforeach
VersionStatusFrozenCreated ByDate
{{ $v->version_label }} {{ ucfirst($v->status) }} {{ $v->is_frozen ? 'Yes' : 'No' }} {{ $v->creator->name ?? '—' }} {{ $v->created_at->format('d M Y') }}
@endif @empty

No contract recorded.

@endforelse {{-- ══ §8 AUDIT TRAIL ══════════════════════════════════════════════════════════ --}}

§8 Audit Trail ({{ $procurement->auditTrails->count() }} entries)

@forelse($procurement->auditTrails->sortByDesc('created_at') as $at) @empty @endforelse
Date/TimeUserActionDescription
{{ $at->created_at->format('d M Y H:i') }} {{ $at->user->name ?? '—' }} {{ $at->action }} {{ $at->description }}
No audit trail entries.