Fix condition check for negative balance

This commit is contained in:
Laurent Destailleur 2025-12-16 01:10:28 +01:00 committed by GitHub
parent e40c6b7c5f
commit bb7502d880
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
}