File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -623,7 +623,7 @@ public static function checkLowInventory()
623623 {
624624 $ consumables = Consumable::withCount ('consumableAssignments as consumable_assignments_count ' )->whereNotNull ('min_amt ' )->get ();
625625 $ accessories = Accessory::withCount ('users as users_count ' )->whereNotNull ('min_amt ' )->get ();
626- $ components = Component::withCount ( ' assets as assets_count ' )-> whereNotNull ('min_amt ' )->get ();
626+ $ components = Component::whereNotNull ('min_amt ' )->get ();
627627
628628 $ avail_consumables = 0 ;
629629 $ items_array = [];
@@ -668,7 +668,7 @@ public static function checkLowInventory()
668668 }
669669
670670 foreach ($ components as $ component ) {
671- $ avail = $ component ->qty - $ component -> assets_count ;
671+ $ avail = $ component ->numRemaining () ;
672672 if ($ avail < ($ component ->min_amt ) + \App \Models \Setting::getSettings ()->alert_threshold ) {
673673 if ($ component ->qty > 0 ) {
674674 $ percent = number_format ((($ avail / $ component ->qty ) * 100 ), 0 );
You can’t perform that action at this time.
0 commit comments