mirror of
https://github.com/grocy/grocy.git
synced 2025-10-12 16:44:55 +00:00
Use stock_log location instead of product location for stock journal (fixes #1381)
This commit is contained in:
28
migrations/0132.sql
Normal file
28
migrations/0132.sql
Normal file
@@ -0,0 +1,28 @@
|
||||
DROP VIEW uihelper_stock_journal;
|
||||
CREATE VIEW uihelper_stock_journal
|
||||
AS
|
||||
SELECT
|
||||
sl.id,
|
||||
sl.row_created_timestamp,
|
||||
sl.correlation_id,
|
||||
sl.undone,
|
||||
sl.undone_timestamp,
|
||||
sl.row_created_timestamp,
|
||||
sl.transaction_type,
|
||||
sl.spoiled,
|
||||
sl.amount,
|
||||
sl.location_id,
|
||||
l.name AS location_name,
|
||||
p.name AS product_name,
|
||||
qu.name AS qu_name,
|
||||
qu.name_plural AS qu_name_plural,
|
||||
u.display_name AS user_display_name
|
||||
FROM stock_log sl
|
||||
JOIN users_dto u
|
||||
ON sl.user_id = u.id
|
||||
JOIN products p
|
||||
ON sl.product_id = p.id
|
||||
JOIN locations l
|
||||
ON sl.location_id = l.id
|
||||
JOIN quantity_units qu
|
||||
ON p.qu_id_stock = qu.id;
|
Reference in New Issue
Block a user