Fix condition check for negative balance
This commit is contained in:
parent
e40c6b7c5f
commit
bb7502d880
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue