mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
Merge pull request #36661 from atm-lucasmantegari/FIX/CanValidatedHolidaysWhenNegativeBalance
FIX - Can Validated Holidays When Negative Balance
This commit is contained in:
@@ -775,7 +775,9 @@ class Holiday extends CommonObject
|
||||
|
||||
if ($checkBalance > 0) {
|
||||
$balance = $this->getCPforUser($this->fk_user, $this->fk_type);
|
||||
if ($balance < 0) {
|
||||
|
||||
$days = num_open_day($this->date_debut, $this->date_fin);
|
||||
if ((($balance - $days) < 0) && getDolGlobalString('HOLIDAY_DISALLOW_NEGATIVE_BALANCE')) {
|
||||
$this->error = 'LeaveRequestCreationBlockedBecauseBalanceIsNegative';
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user