File tree 2 files changed +5
-7
lines changed
hrms/payroll/doctype/gratuity
2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 59
59
{
60
60
"default" : " 0" ,
61
61
"fieldname" : " current_work_experience" ,
62
- "fieldtype" : " Int" ,
63
- "label" : " Current Work Experience"
62
+ "fieldtype" : " Float" ,
63
+ "label" : " Current Work Experience" ,
64
+ "precision" : " 1"
64
65
},
65
66
{
66
67
"default" : " 0" ,
199
200
"index_web_pages_for_search" : 1 ,
200
201
"is_submittable" : 1 ,
201
202
"links" : [],
202
- "modified" : " 2024-03-15 02:50:10.282517 " ,
203
+ "modified" : " 2024-12-11 08:46:04.751908 " ,
203
204
"modified_by" : " Administrator" ,
204
205
"module" : " Payroll" ,
205
206
"name" : " Gratuity" ,
Original file line number Diff line number Diff line change 1
1
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
2
2
# For license information, please see license.txt
3
3
4
-
5
- from math import floor
6
-
7
4
import frappe
8
5
from frappe import _ , bold
9
6
from frappe .query_builder .functions import Sum
@@ -159,7 +156,7 @@ def get_work_experience(self) -> float:
159
156
if rule .method == "Round off Work Experience" :
160
157
work_experience = round (work_experience )
161
158
else :
162
- work_experience = floor (work_experience )
159
+ work_experience = flt (work_experience , self . precision ( "current_work_experience" ) )
163
160
164
161
if work_experience < rule .minimum_year_for_gratuity :
165
162
frappe .throw (
You can’t perform that action at this time.
0 commit comments