mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Change db query for an existing method
This commit is contained in:
parent
ea8f12579d
commit
c055c91739
|
@ -668,9 +668,7 @@ class Helper
|
|||
}
|
||||
|
||||
foreach ($components as $component) {
|
||||
$assets_count = \DB::table('components_assets')->where('component_id', $component->id)->sum('assigned_qty');
|
||||
|
||||
$avail = $component->qty - $assets_count;
|
||||
$avail = $component->numRemaining();
|
||||
if ($avail < ($component->min_amt) + \App\Models\Setting::getSettings()->alert_threshold) {
|
||||
if ($component->qty > 0) {
|
||||
$percent = number_format((($avail / $component->qty) * 100), 0);
|
||||
|
|
Loading…
Reference in a new issue