@php use App\Models\Asset; @endphp @php use App\Helpers\AppHelper; @endphp @extends('layouts.master') @section('title', __('index.assignment')) @section('action', __('index.lists')) @section('main-content')
@include('admin.section.flash_message')
{{ __('index.assignment_list_of') }} {{ $assetDetail->name }}
@forelse($assignmentList as $key => $value) @php // Get the difference in days between returned_date and assigned_date $assignedDate = new DateTime($value->assigned_date); $returnedDate = !empty($value->returned_date) ? new DateTime($value->returned_date) : new DateTime(); // Use today's date if returned_date is not present $daysDifference = $assignedDate->diff($returnedDate)->days +1; @endphp @empty @endforelse
# {{ __('index.employee') }} {{ __('index.assigned_date') }} {{ __('index.returned_date') }} {{ __('index.status') }} {{ __('index.action') }}
{{++$key}} {{ucfirst($value->user->name)}} {{ AppHelper::formatDateForView($value->assigned_date) }} {{ isset($value->returned_date) ? AppHelper::formatDateForView($value->returned_date) : '' }} {{ ($daysDifference > 0) ? '(Used for:'. $daysDifference .' days)' : '' }} {{ucfirst($value->status)}}
  • @if(is_null($value->returned_date) || ($value->return_condition == \App\Enum\AssetAssignmentStatusEnum::assigned->value))
  • Return
  • @endif

{{ __('index.no_records_found') }}

@include('admin.assetManagement.assetDetail.common.return') @include('admin.assetManagement.assetDetail.common.assignment_detail') @endsection @section('scripts') @endsection