From a543bf47efb48afd5b4ca01ecf38da3c2b033321 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 22 Feb 2024 12:29:53 +0530 Subject: [PATCH] fix: timesheet per billed state edge case (backport #40010) (#40029) fix: timesheet per billed state edge case (#40010) If value is 100.0000x then it won't set status correctly but will set it the next time it's loaded from db. (cherry picked from commit 38e88db2c9245a3fec392941d2937cace7bf8e5f) Co-authored-by: Ankush Menat --- erpnext/projects/doctype/timesheet/timesheet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/projects/doctype/timesheet/timesheet.py b/erpnext/projects/doctype/timesheet/timesheet.py index b9d801ce90..e26d04aa9a 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.py +++ b/erpnext/projects/doctype/timesheet/timesheet.py @@ -83,7 +83,7 @@ class Timesheet(Document): def set_status(self): self.status = {"0": "Draft", "1": "Submitted", "2": "Cancelled"}[str(self.docstatus or 0)] - if self.per_billed == 100: + if flt(self.per_billed, self.precision("per_billed")) >= 100.0: self.status = "Billed" if self.sales_invoice: