diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 9227e57fca3..8f9b45de555 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -272,12 +272,12 @@ class Propal extends CommonObject public $address; /** - * @var int availability ID + * @var ?int availability ID can be null in db */ public $availability_id; /** - * @var int availability ID + * @var ?int availability ID * @deprecated * @see $availability_id */ diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d45f07f6a7e..a38c8db46e1 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -490,7 +490,7 @@ abstract class CommonObject public $fk_delivery_address; /** - * @var int Shipping method ID + * @var ?int Shipping method ID * @see setShippingMethod() */ public $shipping_method_id; diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index eef13c94d9b..0133135b05e 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -898,8 +898,9 @@ class Holiday extends CommonObject if ($checkBalance > 0) { $balance = $this->getCPforUser($this->fk_user, $this->fk_type); - $days = num_between_day($this->date_debut, $this->date_fin); - if ($balance - $days < 0 && getDolGlobalString('HOLIDAY_DISALLOW_NEGATIVE_BALANCE')) { + $days = num_public_holiday($this->date_debut, $this->date_fin); + + if ((($balance - $days) < 0) && getDolGlobalString('HOLIDAY_DISALLOW_NEGATIVE_BALANCE')) { $this->error = 'LeaveRequestCreationBlockedBecauseBalanceIsNegative'; return -1; }