Update Employee functionalities: display contract/project name in view details page
This commit is contained in:
@@ -6395,7 +6395,7 @@ def employee_detail(employee_index):
|
|||||||
"""View employee details with attendance summary"""
|
"""View employee details with attendance summary"""
|
||||||
try:
|
try:
|
||||||
# Get employee by index (primary key)
|
# 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
|
# Get attendance statistics for this employee
|
||||||
from models.attendance import AttendanceData
|
from models.attendance import AttendanceData
|
||||||
|
|||||||
@@ -359,7 +359,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="meta-item">
|
<div class="meta-item">
|
||||||
<i class="fas fa-file-contract"></i>
|
<i class="fas fa-file-contract"></i>
|
||||||
Contract ID: {{ employee.contractId }}
|
Contract: {{ employee.contract_name }}
|
||||||
</div>
|
</div>
|
||||||
{% if attendance_stats.latest_attendance %}
|
{% if attendance_stats.latest_attendance %}
|
||||||
<div class="meta-item">
|
<div class="meta-item">
|
||||||
@@ -370,16 +370,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if session.role == 'admin' %}
|
|
||||||
<div class="employee-actions">
|
|
||||||
<a href="{{ url_for('edit_employee', employee_index=employee.index) }}"
|
|
||||||
class="btn btn-warning btn-sm">
|
|
||||||
<i class="fas fa-edit"></i>
|
|
||||||
Edit
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="profile-body">
|
<div class="profile-body">
|
||||||
@@ -404,7 +394,7 @@
|
|||||||
<div class="info-value">
|
<div class="info-value">
|
||||||
<p><strong>Employee ID:</strong> {{ employee.id }}</p>
|
<p><strong>Employee ID:</strong> {{ employee.id }}</p>
|
||||||
<p><strong>Job Title:</strong> {{ employee.display_title }}</p>
|
<p><strong>Job Title:</strong> {{ employee.display_title }}</p>
|
||||||
<p><strong>Contract ID:</strong> {{ employee.contractId }}</p>
|
<p><strong>Contract ID:</strong> {{ employee.contract_name }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user