From bb7502d880e35aaa62f41df2f3dc84755419c4c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Dec 2025 01:10:28 +0100 Subject: [PATCH] Fix condition check for negative balance --- htdocs/holiday/class/holiday.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 812063d3f42..a66e9057937 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -777,7 +777,7 @@ class Holiday extends CommonObject $balance = $this->getCPforUser($this->fk_user, $this->fk_type); $days = num_open_day($this->date_debut, $this->date_fin); - if ($balance - $days < 0 && getDolGlobalString('HOLIDAY_DISALLOW_NEGATIVE_BALANCE')) { + if ((($balance - $days) < 0) && getDolGlobalString('HOLIDAY_DISALLOW_NEGATIVE_BALANCE')) { $this->error = 'LeaveRequestCreationBlockedBecauseBalanceIsNegative'; return -1; }