Fixed #8726 - disallow archived assets to be checked out

This commit is contained in:
snipe 2020-11-12 15:01:13 -08:00
parent 8a65081768
commit f0e04ab9e4

View file

@ -244,11 +244,12 @@ class Asset extends Depreciable
*/
public function availableForCheckout()
{
\Log::debug($this->assetstatus);
if (
(!$this->assignedTo) ||
((!$this->assignedTo) && ($this->assetstatus->archived == 0)) ||
((empty($this->assigned_to)) &&
(empty($this->deleted_at)) &&
(($this->assetstatus) && ($this->assetstatus->deployable == 1))))
(($this->assetstatus) && ($this->assetstatus->deployable == 1))))
{
return true;
}