Merge pull request #4231 from okriuchykhin/ok_SCI_6974

Fix display of stock consumption in assigned items table [SCI-6974]
This commit is contained in:
Alex Kriuchykhin 2022-07-14 09:47:57 +02:00 committed by GitHub
commit 0a8acb36f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,7 +57,7 @@ class RepositoryDatatableService
.where(my_module_repository_rows: { my_module_id: @my_module })
if @repository.has_stock_management?
repository_rows = repository_rows
.select('SUM(my_module_repository_rows.stock_consumption) AS "consumed_stock"')
.select('SUM(DISTINCT my_module_repository_rows.stock_consumption) AS "consumed_stock"')
end
else
repository_rows = repository_rows