@extends('layouts.app') @section('title', 'Approval Instance #' . $instance->instance_id) @section('content')

Approval Instance #{{ $instance->instance_id }}

Back to Approvals
@if(session('success')) @endif @if(session('error')) @endif
Instance Details

{{ $instance->record_type }}

{{ $instance->record_number }}

{{ $instance->record_title }}

@if($instance->status == 'PENDING') Pending @elseif($instance->status == 'APPROVED') Approved @elseif($instance->status == 'REJECTED') Rejected @elseif($instance->status == 'CANCELLED') Cancelled @else {{ $instance->status }} @endif

Step {{ $instance->current_step }}

{{ $instance->initiatedBy->name ?? 'Unknown' }}

{{ $instance->initiated_at ? $instance->initiated_at->format('M d, Y H:i') : 'N/A' }}

@if($instance->completed_at)

{{ $instance->completed_at->format('M d, Y H:i') }}

@endif @if($instance->final_decision)

{{ $instance->final_decision }}

@endif
Uploaded Document
@if(isset($document) && $document)
{{ $document->document_title ?? 'Document' }}
{{ $document->document_code ?? 'No Code' }} | Version {{ $document->version_number ?? '1.0' }}
@if($document->file_path) @if(pathinfo($document->file_path, PATHINFO_EXTENSION) == 'pdf')
@endif @else

No file uploaded for this document.

@endif
@elseif(isset($recordFile) && $recordFile)
{{ $recordFile->document_title ?? 'Document' }}
{{ $recordFile->document_code ?? 'No Code' }}
@if($recordFile->file_path) @if(pathinfo($recordFile->file_path, PATHINFO_EXTENSION) == 'pdf')
@endif @else

No file uploaded for this document.

@endif
@else

No document file available for this approval.

@endif
Workflow Steps
@if(isset($workflowSteps) && $workflowSteps->count() > 0)
@foreach($workflowSteps as $step) @endforeach
Step Name Approver Status
{{ $step->step_order }} {{ $step->step_name }} @if($step->approver_type == 'USER') {{ $step->approver->name ?? 'Not assigned' }} @elseif($step->approver_type == 'ROLE') {{ $step->required_role ?? 'Any' }} @endif @if($step->step_order < $instance->current_step) Completed @elseif($step->step_order == $instance->current_step && $instance->status == 'PENDING') Current @elseif($step->step_order == $instance->current_step && $instance->status != 'PENDING') Final @else Pending @endif
@else

No workflow steps configured

@endif
Approval Actions
@if(isset($actions) && $actions->count() > 0)
@foreach($actions as $action) @endforeach
Approver Action Comment Signature Date
{{ $action->approver->name ?? 'Unknown' }} @if($action->action == 'APPROVE') Approved @elseif($action->action == 'REJECT') Rejected @elseif($action->action == 'COMMENT') Commented @else {{ $action->action }} @endif {{ $action->comment ?? '-' }} @if($action->signature_url) Signature @elseif(isset($employeeSignatures[$action->approver_user_id])) Signature @else No signature @endif {{ $action->created_at ? $action->created_at->format('M d, Y H:i') : 'N/A' }}
@else

No actions recorded yet

@endif
Workflow Information
@if(isset($workflow))
  • Workflow: {{ $workflow->workflow_name ?? 'Unknown' }}
  • Code: {{ $workflow->workflow_code ?? 'N/A' }}
  • Module: {{ $workflow->module_type ?? 'N/A' }}
  • Description: {{ $workflow->description ?? 'N/A' }}
@else

Workflow information not available

@endif
@if(isset($currentUserSignature) && $currentUserSignature && $canApprove)
Your Signature
Your Signature

This signature will be attached to your approval action

@endif @if(isset($canApprove) && $canApprove && $instance->status == 'PENDING')
Take Action
@csrf
@if(isset($currentUserSignature) && $currentUserSignature)
Your Signature Your signature will be attached
@endif
@endif
@endsection