diff --git a/app.py b/app.py index b2436d4..4511d05 100644 --- a/app.py +++ b/app.py @@ -3098,9 +3098,14 @@ 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 = [] for record in attendance_records: diff --git a/static/js/attendance_report.js b/static/js/attendance_report.js index 69a692a..cb7df51 100644 --- a/static/js/attendance_report.js +++ b/static/js/attendance_report.js @@ -812,8 +812,8 @@ function createTableRow(record, displayIndex) {
- - + + ${ record.qr_address.length > 50 ? record.qr_address.substring(0, 50) + "..." diff --git a/templates/attendance_report.html b/templates/attendance_report.html index aa907d7..0a5e668 100644 --- a/templates/attendance_report.html +++ b/templates/attendance_report.html @@ -223,28 +223,16 @@ {% endif %}
- -
- - {% if record.address_source == 'qr' %} - - - - {{ record.qr_address[:45] }}{% if record.qr_address|length > 45 %}...{% endif %} - - {% else %} - - - {% if record.location_accuracy and record.location_accuracy > 0.5 %} - - {% endif %} - {{ record.checked_in_address[:45] }}{% if record.checked_in_address|length > 45 %}...{% endif %} - - {% endif %} + +
+ + + {% if record.qr_address %} + {{ record.qr_address[:50] }}{{ '...' if record.qr_address|length > 50 else '' }} + {% else %} + N/A + {% endif %} +