@extends('patent::layouts.master') @section('title', 'Edit Transaction - ' . $transaction->reference_no) @section('styles') @endsection @section('content')
Edit Transaction
{{ $transaction->reference_no }}
Back to Transactions
@csrf @method('PUT')
Approval Workflow Sequence
@if(config('app.debug'))
Debug Information:
Transaction ID: {{ $transaction->id }}
Role Ranks: {{ json_encode($transaction->role_ranks) }}
Approval Sequence: {{ json_encode($transaction->approval_sequence ?? []) }}
Approval Index: {{ $transaction->approval_index ?? 'null' }}
User Role ID: {{ auth()->user()->role_id ?? 'null' }}
Condition Checks:
Has approval_sequence: {{ isset($transaction->approval_sequence) ? 'YES' : 'NO' }}
Count > 0: {{ isset($transaction->approval_sequence) && count($transaction->approval_sequence) > 0 ? 'YES' : 'NO' }}
Approval sequence type: {{ gettype($transaction->approval_sequence ?? null) }}
Approval sequence count: {{ count($transaction->approval_sequence ?? []) }}
@endif
Debug Output:
Has approval_sequence: {{ isset($transaction->approval_sequence) ? 'YES' : 'NO' }}
Count: {{ count($transaction->approval_sequence ?? []) }}
Is array: {{ is_array($transaction->approval_sequence ?? null) ? 'YES' : 'NO' }}
Raw data: {{ json_encode($transaction->approval_sequence ?? []) }}
@if(isset($transaction->approval_sequence) && count($transaction->approval_sequence) > 0) @foreach($transaction->approval_sequence as $index => $step) @php $status = $step['status'] ?? 'F'; $isDone = $status === 'T'; $isCurrent = $index === $transaction->approval_index; $isPending = !$isDone && !$isCurrent; // Determine styling based on status if ($isDone) { $badgeClass = 'bg-success text-white'; $icon = '✅'; $statusText = 'Approved'; } elseif ($isCurrent) { $badgeClass = 'bg-warning text-dark'; $icon = '⏳'; $statusText = 'Current Step'; } else { $badgeClass = 'bg-secondary text-white'; $icon = '⏸️'; $statusText = 'Waiting'; } @endphp
{{ $icon }} {{ $step['name'] }}
{{ $statusText }} @if($isCurrent)
← Your turn to approve @endif
@if(!$loop->last)
@endif
@endforeach @else
No Approval Workflow Configured

This transaction doesn't have an approval workflow set up.

@if(config('app.debug')) Role Ranks: {{ json_encode($transaction->role_ranks) }}
Approval Sequence: {{ json_encode($transaction->approval_sequence ?? []) }}
@endif
@endif
@if(isset($transaction->approval_sequence) && count($transaction->approval_sequence) > 0)
@php $totalSteps = count($transaction->approval_sequence); $completedSteps = collect($transaction->approval_sequence)->where('status', 'T')->count(); $progressPercentage = $totalSteps > 0 ? ($completedSteps / $totalSteps) * 100 : 0; @endphp
{{ $completedSteps }} of {{ $totalSteps }} steps completed {{ number_format($progressPercentage, 1) }}% Complete
@endif
@php $allDone = collect($transaction->approval_sequence ?? [])->every(fn($step) => $step['status'] === 'T'); @endphp @if(isset($transaction->approval_sequence) && count($transaction->approval_sequence) > 0 && !$allDone)
@elseif(isset($transaction->approval_sequence) && count($transaction->approval_sequence) > 0)
✅ All approval steps completed.
@else
No approval workflow configured for this transaction.
@endif
@error('transaction_type_id')
{{ $message }}
@enderror
This reference is inherited from the patent application
@error('country')
{{ $message }}
@enderror
@error('amount')
{{ $message }}
@enderror
@error('currency')
{{ $message }}
@enderror
Rate to convert to USD
@error('exchange_rate')
{{ $message }}
@enderror
@error('transaction_date')
{{ $message }}
@enderror
@error('deadline')
{{ $message }}
@enderror
@error('bill_deadline')
{{ $message }}
@enderror
@error('status')
{{ $message }}
@enderror
@error('bill_status')
{{ $message }}
@enderror
@error('payment_method')
{{ $message }}
@enderror
@error('transaction_reference')
{{ $message }}
@enderror
@error('invoice_no')
{{ $message }}
@enderror
@error('description')
{{ $message }}
@enderror
@if(isset($transactionComments) && $transactionComments->count() > 0)
🗂 Private Comments
@foreach ($transactionComments as $comment) @endforeach
Type Comment Attachment Added By Added At
{{ ucfirst($comment->status) }} {{ $comment->comment }} @if($comment->file_path) View
Download @else No attachment @endif
{{ $comment->username }} {{ $comment->created_at->format('Y-m-d H:i') }}
@endif @if(isset($publictransactionComments) && $publictransactionComments->count() > 0)
🗂 Public Comments
@foreach ($publictransactionComments as $comment) @endforeach
Type Comment Attachment Added By Added At
{{ ucfirst($comment->status) }} {{ $comment->comment }} @if($comment->file_path) View
Download @else No attachment @endif
{{ $comment->username }} {{ $comment->created_at->format('Y-m-d H:i') }}
@endif
Cancel
@endsection @push('scripts') @endpush