diff --git a/app.py b/app.py index c21063b..959cef9 100644 --- a/app.py +++ b/app.py @@ -6395,7 +6395,7 @@ def employee_detail(employee_index): """View employee details with attendance summary""" try: # Get employee by index (primary key) - employee = Employee.query.get_or_404(employee_index) + employee = Employee.query.outerjoin(Project, Employee.contractId == Project.id).filter(Employee.index == employee_index).first_or_404() # Get attendance statistics for this employee from models.attendance import AttendanceData diff --git a/templates/employee_detail.html b/templates/employee_detail.html index aeffa41..242b97f 100644 --- a/templates/employee_detail.html +++ b/templates/employee_detail.html @@ -359,7 +359,7 @@
{% if attendance_stats.latest_attendance %} - - {% if session.role == 'admin' %} -Employee ID: {{ employee.id }}
Job Title: {{ employee.display_title }}
-Contract ID: {{ employee.contractId }}
+Contract ID: {{ employee.contract_name }}