From dceb77d4d4a70df6a1ab0b4a70b1bf0ad500e64a Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 21 Jan 2023 14:40:20 -0800 Subject: [PATCH] Refactored numRemaining, removed unnecessary numCheckout Signed-off-by: snipe --- app/Models/Accessory.php | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/app/Models/Accessory.php b/app/Models/Accessory.php index 3f2004b04..d39d65338 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] [] - * @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; } /**