Update verification review detail with correct info
This commit is contained in:
@@ -5552,6 +5552,22 @@ def verification_review_detail(record_id):
|
|||||||
# Get the QR code information for additional context
|
# Get the QR code information for additional context
|
||||||
qr_code = QRCode.query.get(record.qr_code_id) if record.qr_code_id else None
|
qr_code = QRCode.query.get(record.qr_code_id) if record.qr_code_id else None
|
||||||
|
|
||||||
|
# Get employee name from Employee table
|
||||||
|
employee_name = None
|
||||||
|
try:
|
||||||
|
if record.employee_id:
|
||||||
|
employee = Employee.query.filter_by(id=int(record.employee_id)).first()
|
||||||
|
if employee:
|
||||||
|
employee_name = f"{employee.lastName}, {employee.firstName}"
|
||||||
|
else:
|
||||||
|
employee_name = f"Unknown (ID: {record.employee_id})"
|
||||||
|
except (ValueError, TypeError) as e:
|
||||||
|
logger_handler.logger.warning(f"Could not lookup employee name for ID {record.employee_id}: {e}")
|
||||||
|
employee_name = f"Unknown (ID: {record.employee_id})"
|
||||||
|
|
||||||
|
# Get event type from QR code (Check In/Check Out)
|
||||||
|
location_event = qr_code.location_event if qr_code and qr_code.location_event else 'N/A'
|
||||||
|
|
||||||
# Log the access for audit trail
|
# Log the access for audit trail
|
||||||
logger_handler.logger.info(
|
logger_handler.logger.info(
|
||||||
f"User {session.get('username')} ({session.get('role')}) "
|
f"User {session.get('username')} ({session.get('role')}) "
|
||||||
@@ -5573,7 +5589,9 @@ def verification_review_detail(record_id):
|
|||||||
record=record,
|
record=record,
|
||||||
qr_code=qr_code,
|
qr_code=qr_code,
|
||||||
check_in_date=check_in_date,
|
check_in_date=check_in_date,
|
||||||
check_in_time=check_in_time)
|
check_in_time=check_in_time,
|
||||||
|
employee_name=employee_name,
|
||||||
|
location_event=location_event)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger_handler.logger.error(f"Error loading verification review detail: {e}")
|
logger_handler.logger.error(f"Error loading verification review detail: {e}")
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
{% extends "base_authenticated.html" %}
|
{% extends "base_authenticated.html" %} {% block title %}Verification Review -
|
||||||
|
QR Code Management{% endblock %} {% block extra_head %}
|
||||||
{% block title %}Verification Review - QR Code Management{% endblock %}
|
|
||||||
|
|
||||||
{% block extra_head %}
|
|
||||||
<style>
|
<style>
|
||||||
.verification-review-page {
|
.verification-review-page {
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
@@ -253,9 +250,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endblock %}
|
{% endblock %} {% block content %}
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<div class="verification-review-page">
|
<div class="verification-review-page">
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<div class="review-header">
|
<div class="review-header">
|
||||||
@@ -263,14 +258,20 @@
|
|||||||
<i class="fas fa-camera-retro"></i>
|
<i class="fas fa-camera-retro"></i>
|
||||||
Verification Photo Review
|
Verification Photo Review
|
||||||
</h1>
|
</h1>
|
||||||
<p>Review and approve/reject employee verification photo for off-site check-in</p>
|
<p>
|
||||||
|
Review and approve/reject employee verification photo for off-site
|
||||||
|
check-in
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Alert for already reviewed records -->
|
<!-- Alert for already reviewed records -->
|
||||||
{% if record.verification_status != 'pending' %}
|
{% if record.verification_status != 'pending' %}
|
||||||
<div class="alert alert-info">
|
<div class="alert alert-info">
|
||||||
<i class="fas fa-info-circle"></i>
|
<i class="fas fa-info-circle"></i>
|
||||||
<span>This verification has already been {{ record.verification_status }}.</span>
|
<span
|
||||||
|
>This verification has already been {{ record.verification_status
|
||||||
|
}}.</span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@@ -288,7 +289,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span class="info-label">Employee Name</span>
|
<span class="info-label">Employee Name</span>
|
||||||
<span class="info-value">{{ record.employee_name or 'Unknown' }}</span>
|
<span class="info-value">{{ employee_name or 'Unknown' }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span class="info-label">Check-in Date</span>
|
<span class="info-label">Check-in Date</span>
|
||||||
@@ -320,27 +321,32 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span class="info-label">Event</span>
|
<span class="info-label">Event</span>
|
||||||
<span class="info-value">{{ record.location_event or 'N/A' }}</span>
|
<span class="info-value">{{ location_event or 'N/A' }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span class="info-label">Distance from QR</span>
|
<span class="info-label">Distance from QR</span>
|
||||||
<span class="info-value">
|
<span class="info-value">
|
||||||
{% if record.location_accuracy %}
|
{% if record.location_accuracy %} {% if record.location_accuracy > 0.5
|
||||||
{% if record.location_accuracy > 0.5 %}
|
%}
|
||||||
<span class="distance-badge distance-high">{{ "%.3f"|format(record.location_accuracy) }} miles</span>
|
<span class="distance-badge distance-high"
|
||||||
|
>{{ "%.3f"|format(record.location_accuracy) }} miles</span
|
||||||
|
>
|
||||||
{% elif record.location_accuracy > 0.2 %}
|
{% elif record.location_accuracy > 0.2 %}
|
||||||
<span class="distance-badge distance-medium">{{ "%.3f"|format(record.location_accuracy) }} miles</span>
|
<span class="distance-badge distance-medium"
|
||||||
|
>{{ "%.3f"|format(record.location_accuracy) }} miles</span
|
||||||
|
>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="distance-badge distance-low">{{ "%.3f"|format(record.location_accuracy) }} miles</span>
|
<span class="distance-badge distance-low"
|
||||||
{% endif %}
|
>{{ "%.3f"|format(record.location_accuracy) }} miles</span
|
||||||
{% else %}
|
>
|
||||||
N/A
|
{% endif %} {% else %} N/A {% endif %}
|
||||||
{% endif %}
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span class="info-label">QR Address</span>
|
<span class="info-label">QR Address</span>
|
||||||
<span class="info-value">{{ qr_code.address if qr_code else 'N/A' }}</span>
|
<span class="info-value"
|
||||||
|
>{{ qr_code.address if qr_code else 'N/A' }}</span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span class="info-label">Check-in Address</span>
|
<span class="info-label">Check-in Address</span>
|
||||||
@@ -359,9 +365,11 @@
|
|||||||
Verification Photo
|
Verification Photo
|
||||||
</h2>
|
</h2>
|
||||||
{% if record.verification_photo %}
|
{% if record.verification_photo %}
|
||||||
<img src="{{ record.verification_photo }}"
|
<img
|
||||||
|
src="{{ record.verification_photo }}"
|
||||||
alt="Verification Photo for {{ record.employee_id }}"
|
alt="Verification Photo for {{ record.employee_id }}"
|
||||||
class="verification-photo">
|
class="verification-photo"
|
||||||
|
/>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="no-photo">
|
<div class="no-photo">
|
||||||
<i class="fas fa-image"></i>
|
<i class="fas fa-image"></i>
|
||||||
|
|||||||
Reference in New Issue
Block a user