{{-- resources/views/reports/transaction-history.blade.php --}} @extends('layouts.base') @section('content')

Transaction History

@if(request('date_from')) @endif @if(request('date_to')) @endif
Back to Reports
{{ $transactions->total() }}
Total Transactions
{{ $transactions->where('type', 'check_in')->count() }}
Check-ins
{{ $transactions->where('type', 'check_out')->count() }}
Check-outs
{{ $transactions->groupBy('laptop_id')->count() }}
Unique Laptops
@forelse($transactions as $transaction) @empty @endforelse
Date/Time Type Laptop Student Staff Condition Notes
{{ $transaction->transaction_time->format('M d, Y H:i') }} {{ ucfirst(str_replace('_', ' ', $transaction->type)) }} {{ $transaction->laptop->asset_tag }}
{{ $transaction->laptop->brand }} {{ $transaction->laptop->model }}
{{ $transaction->student->full_name }}
{{ $transaction->student->student_id }}
{{ $transaction->user->name }} @if($transaction->type === 'check_out') Before: {{ ucfirst($transaction->condition_before ?? 'N/A') }} @else After: {{ ucfirst($transaction->condition_after ?? 'N/A') }} @endif {{ $transaction->notes ?? '-' }}
No transactions found.
{{ $transactions->links() }}

Report generated on {{ now()->format('F d, Y \a\t H:i') }} by {{ auth()->user()->name }}

@if(request('date_from') || request('date_to'))

Filtered by date range: {{ request('date_from') ?: 'Start' }} to {{ request('date_to') ?: 'End' }}

@endif
@endsection