@extends('patent::layouts.master') @section('title', 'Edit Patent Application') @section('content')
@csrf @method('PUT')
Edit Patent Application
@if(Auth::user()->department_id == 1 || Auth::user()->role_id == 1) Create Secretary Ticket Create Request @endif View Changes
@php $statuses = ['Active','Under filing','Closed','Transferred','Rejected','Inactive','Abandon','Inquiry','*****']; @endphp
{{-- Basic Dropdown Fields --}}
{{-- Second Row --}}
{{-- Client & Associate --}}
{{-- Country & Assigned Users --}} {{-- Title & Numbers --}}
{{--
--}}
{{--
--}} {{-- Status --}} {{--
Deadline Tracker
@if (!empty($has_deadline))
@foreach ($has_deadline as $index => $dl) @endforeach
# Country Status Filing Date Deadline (Days) Deadline Date Remaining
{{ $index + 1 }} {{ $dl['country'] }} {{ $dl['deadline_value'] }} @if ($dl['remaining_days'] < 0) {{ $dl['remaining_days'] }} days ago @elseif ($dl['remaining_days'] === 0) Today @else {{ $dl['remaining_days'] }} days left @endif
@else
No deadline records found.
@endif
--}}
@foreach ($country_details as $country) @endforeach
{{-- Attachment & Comments --}}
@if($pt_deadline && count($pt_deadline))
Application History Deadline
{{-- ✅ العمود الجديد --}} @foreach ($pt_deadline as $index => $deadline) @php $remainingDays = \Carbon\Carbon::now()->diffInDays(\Carbon\Carbon::parse($deadline->date), false); @endphp @endforeach
Deadline Comment Deadline Date Remaining DaysCreated At
{{ $deadline->message }} {{ \Carbon\Carbon::parse($deadline->date)->format('Y-m-d') }} @if ($remainingDays >= 0) {{ $remainingDays }} day(s) remaining @else Ended {{ abs($remainingDays) }} day(s) ago @endif {{ \Carbon\Carbon::parse($deadline->created_at)->format('Y-m-d') }}
@endif @if($histories && count($histories))
Application History
@foreach ($histories as $index => $history) @endforeach
# Type Comment Added By File Created At
{{ $index + 1 }} {{ $history->type }} {{ $history->comment }} {{ $history->added_by_name ?? 'N/A' }} @if($history->file_path) View @else No file @endif {{ \Carbon\Carbon::parse($history->created_at)->format('Y-m-d') }}
@endif
@if(Auth::user()->department_id==1 ||Auth::user()->role_id==1 )
Transaction Management
Quick Stats
Total Transactions

{{ \Modules\Patent\Entities\PatentTransaction::where('patent_id', $application->id)->count() }}

Paid Amount

${{ number_format(\Modules\Patent\Entities\PatentTransaction::where('patent_id', $application->id)->where('status', 'paid')->sum('amount_usd'), 2) }}

Pending

${{ number_format(\Modules\Patent\Entities\PatentTransaction::where('patent_id', $application->id)->where('status', 'pending')->sum('amount_usd'), 2) }}

Approved

${{ number_format(\Modules\Patent\Entities\PatentTransaction::where('patent_id', $application->id)->where('status', 'approved')->sum('amount_usd'), 2) }}

@endsection @push('scripts') {{-- Select2 --}} @endpush