Skip to content

A free open source IT asset/license management system

Refactored numRemaining, removed unnecessary numCheckout

snipedceb77d4d4a7
diff --git a/app/Models/Accessory.php b/app/Models/Accessory.php
index 3f2004b047..d39d653382 100755
--- a/app/Models/Accessory.php
+++ b/app/Models/Accessory.php
@@ -327,20 +327,6 @@ class Accessory extends SnipeModel
return null;
}
- /**
- * Check how many items within an accessory are checked out
- *
- * @author [A. Gianotto] [<[email protected]>]
- * @since [v5.0]
- * @return int
- */
- public function numCheckedOut()
- {
- $checkedout = 0;
- $checkedout = $this->users->count();
-
- return $checkedout;
- }
/**
* Check how many items of an accessory remain
@@ -351,11 +337,11 @@ class Accessory extends SnipeModel
*/
public function numRemaining()
{
- $checkedout = $this->users->count();
+ $checkedout = $this->users_count;
$total = $this->qty;
$remaining = $total - $checkedout;
- return $remaining;
+ return (int) $remaining;
}
/**