Update attendance report, modified record will be highlighted
This commit is contained in:
@@ -3258,6 +3258,8 @@ def attendance_report():
|
|||||||
ad.location_accuracy,
|
ad.location_accuracy,
|
||||||
ad.accuracy as gps_accuracy,
|
ad.accuracy as gps_accuracy,
|
||||||
ad.device_info,
|
ad.device_info,
|
||||||
|
ad.created_timestamp,
|
||||||
|
ad.updated_timestamp,
|
||||||
CONCAT(e.firstName, ' ', e.lastName) as employee_name
|
CONCAT(e.firstName, ' ', e.lastName) as employee_name
|
||||||
FROM attendance_data ad
|
FROM attendance_data ad
|
||||||
LEFT JOIN qr_codes qc ON ad.qr_code_id = qc.id
|
LEFT JOIN qr_codes qc ON ad.qr_code_id = qc.id
|
||||||
@@ -3281,6 +3283,8 @@ def attendance_report():
|
|||||||
NULL as location_accuracy,
|
NULL as location_accuracy,
|
||||||
ad.accuracy as gps_accuracy,
|
ad.accuracy as gps_accuracy,
|
||||||
ad.device_info,
|
ad.device_info,
|
||||||
|
ad.created_timestamp,
|
||||||
|
ad.updated_timestamp,
|
||||||
CONCAT(e.firstName, ' ', e.lastName) as employee_name
|
CONCAT(e.firstName, ' ', e.lastName) as employee_name
|
||||||
FROM attendance_data ad
|
FROM attendance_data ad
|
||||||
LEFT JOIN qr_codes qc ON ad.qr_code_id = qc.id
|
LEFT JOIN qr_codes qc ON ad.qr_code_id = qc.id
|
||||||
@@ -3352,6 +3356,8 @@ def attendance_report():
|
|||||||
'location_accuracy': location_accuracy,
|
'location_accuracy': location_accuracy,
|
||||||
'gps_accuracy': gps_accuracy,
|
'gps_accuracy': gps_accuracy,
|
||||||
'device_info': getattr(record, 'device_info', None) or 'Unknown Device',
|
'device_info': getattr(record, 'device_info', None) or 'Unknown Device',
|
||||||
|
'created_timestamp': record.created_timestamp,
|
||||||
|
'updated_timestamp': record.updated_timestamp,
|
||||||
}
|
}
|
||||||
|
|
||||||
# FIXED: Add address display logic based on location accuracy
|
# FIXED: Add address display logic based on location accuracy
|
||||||
|
|||||||
@@ -377,6 +377,22 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Table Cell Content */
|
/* Table Cell Content */
|
||||||
|
.modified-record {
|
||||||
|
background-color: #fff3cd !important;
|
||||||
|
border-left: 3px solid #ffc107 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Make sure there's no animation that causes flashing */
|
||||||
|
.modified-record * {
|
||||||
|
animation: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Remove any existing animations on table rows */
|
||||||
|
tr.modified-record {
|
||||||
|
animation: none !important;
|
||||||
|
transition: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
.employee-info {
|
.employee-info {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -585,7 +585,8 @@ function loadTableData() {
|
|||||||
: "unknown",
|
: "unknown",
|
||||||
device: cells[10] // Updated from cells[9]
|
device: cells[10] // Updated from cells[9]
|
||||||
? cells[10].textContent.trim()
|
? cells[10].textContent.trim()
|
||||||
: ""
|
: "",
|
||||||
|
isModified: row.classList.contains('modified-record'),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -663,6 +664,11 @@ function extractLocationAccuracyLevel(cell) {
|
|||||||
function createTableRow(record, displayIndex) {
|
function createTableRow(record, displayIndex) {
|
||||||
const row = document.createElement("tr");
|
const row = document.createElement("tr");
|
||||||
row.dataset.recordId = record.id;
|
row.dataset.recordId = record.id;
|
||||||
|
|
||||||
|
// Apply highlighting if record was modified
|
||||||
|
if (record.isModified) {
|
||||||
|
row.classList.add('modified-record');
|
||||||
|
}
|
||||||
|
|
||||||
// Debug logging for first few records
|
// Debug logging for first few records
|
||||||
if (displayIndex <= 3) {
|
if (displayIndex <= 3) {
|
||||||
|
|||||||
@@ -180,7 +180,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for record in attendance_records %}
|
{% for record in attendance_records %}
|
||||||
<tr data-record-id="{{ record.id }}">
|
<tr data-record-id="{{ record.id }}" class="{% if record.updated_timestamp > record.created_timestamp %}modified-record{% endif %}">
|
||||||
<td>{{ loop.index }}</td>
|
<td>{{ loop.index }}</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="employee-info">
|
<div class="employee-info">
|
||||||
|
|||||||
Reference in New Issue
Block a user