Skip to content

Commit fd70a60

Browse files
authored
Merge pull request #2509 from frappe/mergify/copy/version-14-hotfix/pr-2460
fix: set correct work experience during gratuity calculation (copy #2460)
2 parents 8d9f676 + 8c84f5a commit fd70a60

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

hrms/payroll/doctype/gratuity/gratuity.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@
5959
{
6060
"default": "0",
6161
"fieldname": "current_work_experience",
62-
"fieldtype": "Int",
63-
"label": "Current Work Experience"
62+
"fieldtype": "Float",
63+
"label": "Current Work Experience",
64+
"precision": "1"
6465
},
6566
{
6667
"default": "0",
@@ -199,7 +200,7 @@
199200
"index_web_pages_for_search": 1,
200201
"is_submittable": 1,
201202
"links": [],
202-
"modified": "2024-03-15 02:50:10.282517",
203+
"modified": "2024-12-11 08:46:04.751908",
203204
"modified_by": "Administrator",
204205
"module": "Payroll",
205206
"name": "Gratuity",

hrms/payroll/doctype/gratuity/gratuity.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
22
# For license information, please see license.txt
33

4-
5-
from math import floor
6-
74
import frappe
85
from frappe import _, bold
96
from frappe.query_builder.functions import Sum
@@ -159,7 +156,7 @@ def get_work_experience(self) -> float:
159156
if rule.method == "Round off Work Experience":
160157
work_experience = round(work_experience)
161158
else:
162-
work_experience = floor(work_experience)
159+
work_experience = flt(work_experience, self.precision("current_work_experience"))
163160

164161
if work_experience < rule.minimum_year_for_gratuity:
165162
frappe.throw(

0 commit comments

Comments
 (0)