-
Notifications
You must be signed in to change notification settings - Fork 754
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: set correct work experience during gratuity calculation #2460
Conversation
@@ -159,7 +159,7 @@ def get_work_experience(self) -> float: | |||
if rule.method == "Round off Work Experience": | |||
work_experience = round(work_experience) | |||
else: | |||
work_experience = floor(work_experience) | |||
work_experience = flt(work_experience, precision=1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
work_experience = flt(work_experience, precision=1) | |
work_experience = flt(work_experience, self.precision("current_work_experience")) |
Instead of using a hardcoded precision let's set field level precision. You can set 1 as the default precision in core for this field. So when people want to have more precision, they can just customize field level precision and this calculation will get adjusted
Why didn't linter catch this da17577? 🤔 |
@Mergifyio backport version-14-hotfix version-15-hotfix |
✅ Backports have been created
|
Fix work experience calculation for gratuity rules using the Take Exact Completed Years method. Previously, the experience was rounded to a whole number instead of using the exact decimal value (eg. 1.4 years was incorrectly treated as 1 year).
Gratuity Rule:
Before:
After: