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 (backport #2471) #2675

Merged
merged 3 commits into from
Jan 21, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 21, 2025

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.


This is an automatic backport of pull request #2471 done by Mergify.

@mergify mergify bot requested a review from ruchamahabal as a code owner January 21, 2025 05:56
@nabinhait nabinhait merged commit 6f955a6 into version-15-hotfix Jan 21, 2025
8 checks passed
@frappe-pr-bot
Copy link
Collaborator

🎉 This PR is included in version 15.38.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants