@extends('layouts.app')
@php
$pageTitle = 'Transactions';
$pageHeading = 'Transaction Monitor';
$pageDescription = 'Pantau log absensi mentah dari mesin dengan filter cepat dan label state yang jelas.';
$tableThemeClass = 'ops-datatable-theme ops-datatable-theme--transactions';
$sortBy = $filters['sort_by'] ?? 'punch_time';
$sortDir = $filters['sort_dir'] ?? 'desc';
$sortIcon = function (string $column) use ($sortBy, $sortDir): string {
if ($sortBy !== $column) {
return '↕';
}
return $sortDir === 'asc' ? '↑' : '↓';
};
$sortUrl = function (string $column) use ($filters, $sortBy, $sortDir): string {
$query = array_filter($filters, fn ($value) => $value !== null && $value !== '' && $value !== []);
$query['sort_by'] = $column;
$query['sort_dir'] = $sortBy === $column && $sortDir === 'asc' ? 'desc' : 'asc';
return route('transactions.index', $query);
};
@endphp
@section('content')
Transaction List
@forelse ($transactions as $item)
ID {{ $sortIcon('id') }}
Emp Code {{ $sortIcon('emp_code') }}
Name {{ $sortIcon('employee_name') }}
Punch Time {{ $sortIcon('punch_time') }}
State {{ $sortIcon('punch_state') }}
Source {{ $sortIcon('source') }}
Verify {{ $sortIcon('verify_type') }}
Work Code
Terminal {{ $sortIcon('terminal_sn') }}
Notes {{ $sortIcon('reserved') }}
Upload Time {{ $sortIcon('upload_time') }}
@empty
{{ $item->id }}
{{ $item->emp_code }}
{{ $item->employee_name ?: '-' }}
{{ $item->punch_time }}
{{ $stateLabels[(int) $item->punch_state] ?? ('UNKNOWN (' . $item->punch_state . ')') }}
@if ($item->source_label === 'Manual Correction')
{{ $item->source_label }}
@else
{{ $item->source_label }}
@endif
{{ $verifyTypeLabels[(int) $item->verify_type] ?? ('TYPE ' . $item->verify_type) }}
{{ $workCodeLabels[(int) ($item->work_code ?? 0)] ?? (($item->work_code ?? 0) === null ? '-' : ('CODE ' . $item->work_code)) }}
{{ $item->terminal_sn }}
{{ $item->reserved ?: '-' }}
{{ $item->upload_time }}
@endforelse
Belum ada data transaksi.