Employee Name:
{{ $showDetails->employeeMaster->employee_name ?? '-' }}
Type:
{{ $showDetails->type ?? '-' }}
Send to Travel Desk:
{{ ($showDetails->send_to_travel_desk === 0) ? 'No' : 'Yes' }}
@php
$statuses = [
'Requested' => ['label' => 'Requested', 'class' => 'info'],
'Reporting Approved' => ['label' => 'Reporting Approved', 'class' => 'success'],
'Reporting Rejected' => ['label' => 'Reporting Rejected', 'class' => 'danger'],
'Booking Done' => ['label' => 'Booking Done', 'class' => 'primary'],
'Cancelled' => ['label' => 'Cancelled', 'class' => 'danger'],
];
$status = $statuses[$showDetails->status] ?? ['label' => '', 'class' => ''];
$disabled = in_array($showDetails->status, ['Reporting Approved', 'Reporting Rejected', 'Booking Done', 'Cancelled']) ? 'disabled' : '';
$canChangeStatus = false;
$currentUser = auth()->user();
// Check if current user is Super Admin
if ($currentUser->hasRole('Super Admin')) {
$canChangeStatus = true;
}
// Check if current user is the reporting person of the employee who created the plan
if ($showDetails->employeeMaster && $showDetails->employeeMaster->reporting_person_id == $currentUser->id) {
$canChangeStatus = true;
}
@endphp
Status:
@if ($canChangeStatus)
@else
{{ $status['label'] }}
@endif
Destination Type:
{{ $showDetails->destination_type ?? '-' }}
Travel Plan Period:
{{ date('d-m-Y', strtotime($showDetails->start_date)) }} To
{{ date('d-m-Y', strtotime($showDetails->end_date)) }}
Mod Of Travel:
{{ $showDetails->getModOfTravelNamesAttribute() ?? '-' }}
Current Expense Limit:
{{ number_format($remainingExpenseLimit, 2, '.', '') ?? '-' }}