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

fix: earned leave exceeding annual allocation #397

Merged
merged 5 commits into from
Mar 20, 2023

Conversation

ruchamahabal
Copy link
Member

@ruchamahabal ruchamahabal commented Mar 20, 2023

Problem

Leave Policy with Earned Leave created
Annual Allocation (Leave Policy): 22
Rounding (Leave Type): 1.0

Monthly earned leave = round(22/12) = round(1.83) = 2
2 leaves get allocated for 11 months, so 22 leaves annual allocation is fulfilled
2 more leaves get allocated in the 12th month, making total leaves = 24 (exceeds annual allocation of 22)

Solution

While allocating earned leaves, make sure new allocation without carry forwarded leaves is not exceeding the annual allocation quota.
Excluding carry forwarding allocations in this check is important since users might have carry forwarded leaves + earned leaves annual allocation.

TODO

  • Avoid over allocation during backdated allocation creation (for past months)

@ruchamahabal
Copy link
Member Author

ruchamahabal commented Mar 20, 2023

TODO (will cover in a separate PR):

  • Disable editing New Leaves Allocated in an earned leave allocation (since they are allocated by the scheduler)

ref: #399

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

Successfully merging this pull request may close these issues.

1 participant