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: gratuity calculation for 'Sum of all previous slabs' option #2471

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

AyshaHakeem
Copy link
Contributor

@AyshaHakeem AyshaHakeem commented Dec 2, 2024

Employees with experience matching the upper limit of a slab are now correctly applied the appropriate Gratuity Rule Slab for Gratuity calculation.

Example:
For an Employee with exactly 5 years of experience and the following Gratuity Rule Slabs:
0-5 years: Fraction = 0.7
5-0 years: Fraction = 1.0

The calculation incorrectly placed the employee in the second slab due to the condition in _is_experience_within_slab. This caused an amount higher than the correct gratuity amount to be calculated.

Also, the years_left calculation was only updated within the if _is_experience_beyond_slab block.

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