Fix: Incentives was not working

This commit is contained in:
Amritanshu Agrawal 2021-09-26 09:34:16 +05:30
parent c3bd22fc9f
commit 4f907e965b

View File

@ -221,10 +221,13 @@ def get_employees(
db: Session,
) -> List[schema_in.IncentiveEmployee]:
details = []
employees = db.execute(
select(Employee)
.where(Employee.joining_date <= finish_date, or_(Employee.is_active, Employee.leaving_date >= start_date))
.order_by(Employee.cost_centre_id, Employee.designation, Employee.name)
employees = (
db.execute(
select(Employee)
.where(Employee.joining_date <= finish_date, or_(Employee.is_active, Employee.leaving_date >= start_date))
.order_by(Employee.cost_centre_id, Employee.designation, Employee.name)
)
.scalars()
.all()
)