I m setting up gratuity for employees
this is my configuration
the salary is calculated accuratly but it is not rounding offf the work experince as i selected the option (take exact completed years) so it should take 3 years not 3.6
It looks like ERPNext is calculating gratuity based on the total service period (3.6 years) rather than limiting the calculation to completed years only, even when “Take Exact Completed Years” is enabled.
For UAE gratuity calculations, completed years can significantly affect the final amount. For example, an employee with 3 years and 7 months of service may receive a different result depending on whether the system uses exact service duration or only completed years.
I recently tested this scenario using a UAE Gratuity Calculator and noticed that the expected result should be based on 3 completed years when that option is selected. It might be worth checking whether the gratuity formula is referencing total service days instead of the rounded completed years value.
Has anyone else experienced the same behavior in ERPNext v15?
I noticed something similar while checking gratuity calculations. The salary figures seem to be correct, but the service period appears to be affecting the result differently from what the “Take Exact Completed Years” setting suggests.
If an employee has completed 3 years but the actual service duration is 3.6 years, I would expect the gratuity calculation to use 3 completed years when that option is selected.
I usually cross-check these calculations with a gratuity calculator uae to see whether the result matches the expected service period. It would be interesting to know if this is a configuration issue or something in the ERPNext calculation logic.
The issue appears to be with the ERPNext/HRMS v15 gratuity calculation logic. Even when “Take Exact Completed Years” is enabled, the system is reportedly considering the actual service duration (for example, 3.6 years) instead of only 3 completed years.
A temporary code-level solution is to use only the completed years: