3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-08-18 11:15:42 +00:00

Fix division by zero?

This commit is contained in:
snipe
2026-04-09 15:08:46 +01:00
parent fde6ff1571
commit f49837e5fe

View File

@ -170,6 +170,10 @@ class Consumable extends SnipeModel
return 100;
}
if ($this->qty == '') {
return 1;
}
return ($this->qty - $this->consumables_users_count) / $this->qty * 100;
}