Merge pull request #36661 from atm-lucasmantegari/FIX/CanValidatedHolidaysWhenNegativeBalance
FIX - Can Validated Holidays When Negative Balance
This commit is contained in:
commit
ec91c8ddd2
1 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue