Update attendance report display

This commit is contained in:
Nguyen Ngo
2025-08-15 12:11:22 -04:00
parent 491a6f537c
commit 47760d55c0
3 changed files with 19 additions and 26 deletions
+6 -1
View File
@@ -3098,8 +3098,13 @@ def attendance_report():
# Execute query
query_result = db.session.execute(text(base_query), params)
attendance_records = query_result.fetchall()
print(f"✅ Found {len(attendance_records)} attendance records")
# Log first 3 records to verify QR address data
for i, record in enumerate(attendance_records[:3]):
print(f"📊 Record {i+1}: Employee={record.employee_id}")
print(f" QR Address: {getattr(record, 'qr_address', 'NOT_FOUND')}")
print(f" Check-in Address: {getattr(record, 'checked_in_address', 'NOT_FOUND')}")
print(f" Location Accuracy: {getattr(record, 'location_accuracy', 'NOT_FOUND')}")
# FIXED: Process records to add calculated fields with proper datetime handling
processed_records = []
+2 -2
View File
@@ -812,8 +812,8 @@ function createTableRow(record, displayIndex) {
</td>
<td>
<div class="address-info qr-address">
<i class="fas fa-qrcode"></i>
<span title="${record.qr_address}">
<i class="fas fa-qrcode" style="color: #6366f1; margin-right: 4px;" title="QR Code Address (Fixed)"></i>
<span title="QR Address: ${record.qr_address}">
${
record.qr_address.length > 50
? record.qr_address.substring(0, 50) + "..."
+7 -19
View File
@@ -223,28 +223,16 @@
{% endif %}
</div>
</td>
<td class="address-column">
<div class="address-info checkin-address">
<i class="fas fa-location-arrow"></i>
{% if record.address_source == 'qr' %}
<!-- Using QR address due to high accuracy (≤ 0.5 miles) -->
<span title="QR Address (High Accuracy ≤ 0.5 mi): {{ record.qr_address }}"
class="address-high-accuracy">
<i class="fas fa-check-circle" style="color: #059669; margin-right: 4px;"
title="High accuracy - showing QR location"></i>
{{ record.qr_address[:45] }}{% if record.qr_address|length > 45 %}...{% endif %}
</span>
<td>
<div class="address-info qr-address">
<i class="fas fa-qrcode" style="color: #6366f1; margin-right: 4px;" title="QR Code Address (Fixed)"></i>
<span title="QR Address: {{ record.qr_address or 'N/A' }}">
{% if record.qr_address %}
{{ record.qr_address[:50] }}{{ '...' if record.qr_address|length > 50 else '' }}
{% else %}
<!-- Using actual check-in address due to lower accuracy (> 0.5 miles) or no accuracy data -->
<span title="Check-in Address{% if record.location_accuracy %} (Accuracy: {{ '%.3f'|format(record.location_accuracy) }} mi){% endif %}: {{ record.checked_in_address }}"
class="address-normal-accuracy">
{% if record.location_accuracy and record.location_accuracy > 0.5 %}
<i class="fas fa-exclamation-triangle" style="color: #f59e0b; margin-right: 4px;"
title="Lower accuracy - showing actual check-in location"></i>
N/A
{% endif %}
{{ record.checked_in_address[:45] }}{% if record.checked_in_address|length > 45 %}...{% endif %}
</span>
{% endif %}
</div>
</td>
<td class="address-column">