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, db: Session,
) -> List[schema_in.IncentiveEmployee]: ) -> List[schema_in.IncentiveEmployee]:
details = [] details = []
employees = db.execute( employees = (
db.execute(
select(Employee) select(Employee)
.where(Employee.joining_date <= finish_date, or_(Employee.is_active, Employee.leaving_date >= start_date)) .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) .order_by(Employee.cost_centre_id, Employee.designation, Employee.name)
)
.scalars()
.all() .all()
) )