@extends('garage.layouts.app') @section('content') @include('garage.hr.styles')
Device mapping
{{ $device->name }} · {{ $device->ip }}:{{ $device->port }}
Punches match only when Device user ID (Dahua UserID) equals the employee Attendance code in HR or the value saved in mapping below. Device names are not used for attendance.
Back @if(($autoApplyCount ?? 0) > 0)
@csrf
@endif
@csrf
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif @if(($unmappedCount ?? 0) > 0)
{{ $unmappedCount }} punch(es) are not linked to any employee. View unmapped logs
@endif @if(!empty($unmappedSuggestions))
Unmapped on device — link to employee {{ count($unmappedSuggestions) }} identity(ies)
@foreach($unmappedSuggestions as $row) @php $id = $row['identity']; $top = $row['suggestions'][0] ?? null; @endphp @endforeach
Device user ID Name on device Card Punches Suggested employee
{{ $id->device_user_id ?: '—' }} {{ $id->person_name ?: '—' }} {{ $id->card_no ?: '—' }} {{ $id->punch_count }} @if($top) {{ $top['employee_name'] }} {{ $top['score'] }}% match @if(count($row['suggestions']) > 1)
Also: {{ $row['suggestions'][1]['employee_name'] }} ({{ $row['suggestions'][1]['score'] }}%)
@endif @else No name to match — set User ID below @endif
@if($top) Use suggestion @endif
@endif
@csrf
@foreach($employees as $e) @php $m = $existing[$e->id] ?? null; $prefillUser = $m->device_user_id ?? ($e->attendance_code ?? ''); $prefillCard = $m->card_no ?? ($e->card_no ?? ''); $prefillName = $m->device_person_name ?? ($e->attendance_device_name ?? ''); @endphp @endforeach
Employee (HR) Device user ID Name on device Card no Active
{{ $e->name }}
Code: {{ $e->code ?: '—' }} @if(!empty($e->attendance_code) && $e->attendance_code !== ($m->device_user_id ?? '')) · User ID in HR: {{ $e->attendance_code }} @endif @if(! $e->is_active) · inactive @endif
id.device_user_id", $prefillUser) }}" placeholder="e.g. 14" /> id.device_person_name", $prefillName) }}" placeholder="Exact CardName on device" /> id.card_no", $prefillCard) }}" placeholder="CardNo" /> id.is_active", (bool)($m->is_active ?? true))) />
@endsection