Refactored numRemaining, removed unnecessary numCheckout

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2023-01-21 14:40:20 -08:00
parent 46e3e8a3dd
commit dceb77d4d4

View file

@ -327,20 +327,6 @@ class Accessory extends SnipeModel
return null;
}
/**
* Check how many items within an accessory are checked out
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @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;
}
/**