Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlapping diagnostics is broken #385

Open
jhjourdan opened this issue Feb 28, 2023 · 0 comments
Open

Overlapping diagnostics is broken #385

jhjourdan opened this issue Feb 28, 2023 · 0 comments

Comments

@jhjourdan
Copy link

The "leaves period" in my company is from June, 1st to May, 31st. When I go to the overlapping diagnostics panel, all the leaves starting before June, 1st are shown, even if they end before the May, 31st.

The reason is that the SQL query which is used to show the overlapping leaves is broken:

SELECT CONCAT(users.firstname, ' ', users.lastname) AS user_label,
            contracts.id AS contract_id, contracts.name AS contract_label,
            status.name AS status_label,
            leaves.*,
            REPLACE(contracts.startentdate, '/', '-')
            FROM leaves
            inner join users on leaves.employee = users.id
            inner join contracts on users.contract = contracts.id
            inner join status on status.id = leaves.status
            WHERE leaves.startdate < CAST(CONCAT(YEAR(leaves.enddate), '-', REPLACE(contracts.startentdate, '/', '-')) AS DATE)
            ORDER BY users.id ASC, leaves.startdate DESC

I.e., it checks whether the start date of the leaves begins after the period starting in the current year, which is not at all what we want...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants