hrms icon indicating copy to clipboard operation
hrms copied to clipboard

calculate_tax_by_tax_slab has bug - adding 1 for nothing

Open tinodj opened this issue 1 year ago • 0 comments

Information about bug

While it might working adding 1 for some currencies, with EUR this makes inconsistencies.

1 should be removed and is not necessary - it calculates wrongly.

Imagine the following brackets/slabs:

0-100 10% 100-200 20%

Someone getting 200 income tax should be: 30.

However, this function calculates: 30.3

In EUR (and many other currencies) very often these slabs are defined on two decimal places.

https://github.com/frappe/hrms/blob/9d8c78de8b52256c3355202f6d1031cfde1bb4b2/hrms/payroll/doctype/salary_slip/salary_slip.py#L2091

Module

HR, Payroll

Version

ERPNext: v15.14.4 (version-15)

Frappe Framework: v15.15.0 (version-15)

Frappe HR: v15.12.0 (version-15)

Installation method

None

Relevant log output / Stack trace / Full Error Message.

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

tinodj avatar Feb 22 '24 23:02 tinodj