bbalet / jorani

Leave and Overtime Management System
http://jorani.org/
GNU Affero General Public License v3.0
389 stars 276 forks source link

User's Can Request Holiday for Two Leave Periods #397

Open ColonelPanics opened 1 year ago

ColonelPanics commented 1 year ago

What is the version of Jorani?

1.0.0

Expected behavior

When a user attempts to request leave that overlaps two leave periods they should be informed that they cannot do that and should not be able to request it.

Actual behavior

There are two different observed behaviour, these are:

  1. If the first day of the leave request is the Month / End and Day / End of the contract then there is no warning/error for going between 2 leave periods
  2. Otherwise, a holiday request that goes between 2 leave periods has an pop-up that tells the user they cannot do that, however, if the user clicks Ok they can then Request the holiday (pictured below)
Screenshot 2023-08-22 at 10 50 18

When this is requested it is suggested to the manager as a regular holiday and, if approved by the manager, the days are taken from neither period making it possible for a user to obtain holiday that isn't taken from their entitlement.

Steps to reproduce the behavior

  1. Install Jorani
  2. Login as default user
  3. Update Global Contract
    1. Month / Start: August
    2. Day / Start: 1
    3. Month / End: July
    4. Month / End: 31
  4. Add entitled days for Global contract
    1. 08/01/22 -> 31/07/23: 10 days
    2. 08/01/23 -> 31/07/24: 10 days
    3. 08/01/24 -> 31/07/25: 10 days
  5. Set weekends as days off in the Global contract
  6. Add a test user on the Global contract
  7. Login as test user and request leave
    1. 31/07/24 -> 06/08/24 - This will result in Actual behaviour 1
    2. 30/07/24 -> 06/08/24 - This will result in Actual behaviour 2
    3. Have tried both of those without the other one existing and the observed behaviour is as reported