merge: integrate inventory threshold 20% fix
This commit is contained in:
commit
5574f845ab
@ -207,7 +207,8 @@ class RemoteController extends Controller
|
||||
$machineQuery = Machine::withCount([
|
||||
'slots as slots_count',
|
||||
'slots as low_stock_count' => function ($query) {
|
||||
$query->where('stock', '<=', 5);
|
||||
$query->where('max_stock', '>', 0)
|
||||
->whereRaw('stock <= (max_stock * 0.2)');
|
||||
},
|
||||
'slots as expiring_soon_count' => function ($query) {
|
||||
$query->whereNotNull('expiry_date')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user