Added project dropdown in Time Attendance import

This commit is contained in:
2025-10-13 11:44:11 -04:00
parent 8269751b08
commit 08b814d294
4 changed files with 75 additions and 4 deletions
+5 -1
View File
@@ -41,11 +41,15 @@ class TimeAttendance(base.db.Model):
import_batch_id = base.db.Column(base.db.String(36), nullable=True, index=True)
import_date = base.db.Column(base.db.DateTime, default=datetime.utcnow)
import_source = base.db.Column(base.db.String(100), nullable=True)
project_id = base.db.Column(base.db.Integer, base.db.ForeignKey('projects.id'), nullable=True, index=True)
# Audit fields
created_by = base.db.Column(base.db.Integer, base.db.ForeignKey('users.id'), nullable=True)
created_date = base.db.Column(base.db.DateTime, default=datetime.utcnow)
updated_date = base.db.Column(base.db.DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)
# Relationship
project = base.db.relationship('Project', backref='time_attendance_records')
def __repr__(self):
return f'<TimeAttendance {self.employee_id} - {self.employee_name} at {self.location_name} on {self.attendance_date}>'