@extends('admin.layouts.app') @section('title', get_setting('site_name').' | '.__('Return & damage history')) @include('admin.asset.partials.page_styles') @section('content')

{{ __('Return & damage history') }}

{{ __('Track returned, consumed, and damaged assets across the organization.') }}

{{ __('Active assignments') }}
{{ ($tab ?? 'returns') === 'damages' ? __('Damage reports') : __('Return history') }}
@if($records->total() > 0) {{ $records->firstItem() }}–{{ $records->lastItem() }} {{ __('of') }} {{ $records->total() }} @endif
{{ __('Reset') }}
@if(($tab ?? 'returns') === 'damages') @forelse($records as $row) @empty @endforelse
{{ __('Date') }} {{ __('Asset') }} {{ __('Employee') }} {{ __('Severity') }} {{ __('Status') }} {{ __('Description') }}
{{ $row->reported_at?->format('Y-m-d') ?? $row->created_at?->format('Y-m-d') }} {{ $row->asset?->name ?? '—' }}
{{ $row->asset?->identity ?? $row->asset?->code ?? '—' }}
{{ $row->staff?->user?->name ?? '—' }} {{ ucfirst($row->severity ?? '—') }} {{ ucfirst($row->status ?? 'open') }} {{ \Illuminate\Support\Str::limit($row->description ?? '—', 80) }} @if($row->asset_id) {{ __('View') }} @endif
{{ __('No damage reports found.') }}
@else @forelse($records as $row) @php $isDamaged = (int) $row->status === 4; $condition = $row->return_condition ?: ($isDamaged ? 'damaged' : ($row->return ? 'returned' : '—')); @endphp @empty @endforelse
{{ __('Date') }} {{ __('Asset') }} {{ __('Employee') }} {{ __('Qty') }} {{ __('Condition') }} {{ __('Status') }} {{ __('Note') }}
{{ $row->returned_at?->format('Y-m-d') ?? $row->updated_at?->format('Y-m-d') }} {{ $row->asset_item?->name ?? '—' }}
{{ $row->asset_item?->identity ?? $row->asset_item?->code ?? '—' }}
{{ $row->staff?->user?->name ?? '—' }} {{ $row->qty }} {{ ucfirst(str_replace('_', ' ', $condition)) }} @if($isDamaged) {{ __('Damaged') }} @elseif($condition === 'consumed') {{ __('Consumed') }} @else {{ __('Returned') }} @endif {{ \Illuminate\Support\Str::limit($row->note ?? '—', 60) }} @if($row->asset_id) {{ __('View') }} @endif
{{ __('No return history found.') }}
@endif
@if($records->hasPages())
{{ $records->links() }}
@endif
@endsection