fix(accounts): round cost center allocation percentage total

(cherry picked from commit 8b894280cd)
This commit is contained in:
nareshkannasln
2026-10-26 16:22:23 +00:00
committed by Mergify
parent 6ae2594a63
commit 621b72d399
@@ -62,7 +62,7 @@ class CostCenterAllocation(Document):
def validate_total_allocation_percentage(self):
total_percentage = sum([flt(d.percentage) for d in self.get("allocation_percentages", [])])
if total_percentage != 100:
if flt(total_percentage, self.precision("percentage", "allocation_percentages")) != 100:
frappe.throw(_("Total percentage against cost centers should be 100"), WrongPercentageAllocation)
def validate_from_date_based_on_existing_gle(self):