Skip to content

A free open source IT asset/license management system

Brings back the „pending“ state when checking out (#5837)

Till Deekedbd177576e22
diff --git a/app/Models/Asset.php b/app/Models/Asset.php
index 92085b582f..984ca0e085 100644
--- a/app/Models/Asset.php
+++ b/app/Models/Asset.php
@@ -30,6 +30,7 @@ class Asset extends Depreciable
const ASSET = 'asset';
const USER = 'user';
+ const ACCEPTANCE_PENDING = 'pending';
/**
* Set static properties to determine which checkout/checkin handlers we should use
*/
@@ -192,6 +193,17 @@ class Asset extends Depreciable
}
}
+ /**
+ * Does the user have to confirm that they accept the asset?
+ *
+ * If so, set the acceptance-status to "pending".
+ * This value is used in the unaccepted assets reports, for example
+ *
+ * @see https://github.com/snipe/snipe-it/issues/5772
+ */
+ if ($this->requireAcceptance() && $target instanceof User) {
+ $this->accepted = self::ACCEPTANCE_PENDING;
+ }
if ($this->save()) {
$this->logCheckout($note, $target);