mirror of
https://github.com/grocy/grocy.git
synced 2026-03-27 23:29:25 +01:00
Fixed product average price rounding
This commit is contained in:
parent
68aad90a59
commit
af4715e17f
9
migrations/0201.sql
Normal file
9
migrations/0201.sql
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
DROP VIEW products_average_price;
|
||||
CREATE VIEW products_average_price
|
||||
AS
|
||||
SELECT
|
||||
1 AS id, -- Dummy, LessQL needs an id column
|
||||
s.product_id,
|
||||
SUM(s.amount * s.price) / SUM(s.amount) as price
|
||||
FROM stock s
|
||||
GROUP BY s.product_id;
|
||||
Loading…
Reference in New Issue
Block a user