diff --git a/src/QUI/ERP/Order/AbstractOrder.php b/src/QUI/ERP/Order/AbstractOrder.php index 642fa31ddfd1203a88a5361b7496f361b3ef58e1..e5e45d5d3f7e1cd39b9b8ca0058fd145270a560f 100644 --- a/src/QUI/ERP/Order/AbstractOrder.php +++ b/src/QUI/ERP/Order/AbstractOrder.php @@ -439,6 +439,7 @@ protected function setDataBaseData(array $data): void // validate shipping try { + // @phpstan-ignore-next-line $this->validateShipping($this->getShipping()); } catch (QUI\Exception) { $this->shippingId = null; @@ -473,7 +474,7 @@ protected function setDataBaseData(array $data): void * @param QUI\Interfaces\Users\User|null $PermissionUser * @return ErpEntityInterface|null */ - public function reversal(string $reason = '', QUI\Interfaces\Users\User $PermissionUser = null): ?ErpEntityInterface + public function reversal(string $reason = '', null | QUI\Interfaces\Users\User $PermissionUser = null): ?ErpEntityInterface { $this->delete($PermissionUser); return null; @@ -673,13 +674,13 @@ public function toArray(): array QUI\System\Log::writeDebugException($Exception); } - if ($this->getShippingStatus()) { + if (class_exists('QUI\ERP\Shipping\ShippingStatus\Status') && $this->getShippingStatus()) { $shippingStatus = $this->getShippingStatus()->getId(); } $shipping = ''; - if ($this->getShipping()) { + if (class_exists('QUI\ERP\Shipping\Types\ShippingEntry') && $this->getShipping()) { $shipping = $this->getShipping()->getId(); }