Skip to content

Commit

Permalink
fix: set field level precision for work experience field in gratuity
Browse files Browse the repository at this point in the history
  • Loading branch information
AyshaHakeem committed Dec 11, 2024
1 parent dab160e commit ce75e4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions hrms/payroll/doctype/gratuity/gratuity.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
"default": "0",
"fieldname": "current_work_experience",
"fieldtype": "Float",
"label": "Current Work Experience"
"label": "Current Work Experience",
"precision": "1"
},
{
"default": "0",
Expand Down Expand Up @@ -199,7 +200,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2024-10-25 15:33:11.549493",
"modified": "2024-12-11 08:46:04.751908",
"modified_by": "Administrator",
"module": "Payroll",
"name": "Gratuity",
Expand Down
2 changes: 1 addition & 1 deletion hrms/payroll/doctype/gratuity/gratuity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = flt(work_experience, precision=1)
work_experience = flt(work_experience, self.precision("current_work_experience"))

if work_experience < rule.minimum_year_for_gratuity:
frappe.throw(
Expand Down

0 comments on commit ce75e4e

Please sign in to comment.