From f0e04ab9e4e60fbf16d266baefe0ef16097aa34c Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 12 Nov 2020 15:01:13 -0800 Subject: [PATCH] Fixed #8726 - disallow archived assets to be checked out --- app/Models/Asset.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Models/Asset.php b/app/Models/Asset.php index 8404a0e1d7..376be08fcb 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -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; }