1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-18 07:52:23 +01:00

(bug) filter product is available in admin products list

This commit is contained in:
Du Peng 2022-10-20 14:40:52 +02:00
parent 0abb3641df
commit de960cf00c

View File

@ -159,8 +159,10 @@ class ProductService
products = if filters[:stock_from].to_i.positive?
products.where('(stock ->> ?)::int >= ?', filters[:stock_type], filters[:stock_from])
else
elsif !operator&.privileged?
products.where('(stock ->> ?)::int >= quantity_min', filters[:stock_type])
else
products
end
products = products.where('(stock ->> ?)::int <= ?', filters[:stock_type], filters[:stock_to]) if filters[:stock_to].to_i != 0