Optimized/clarified new "Hide product from stock overview" option (references #906)

This commit is contained in:
Bernd Bestel
2020-12-21 20:43:10 +01:00
parent 694b78f72a
commit c1ac9e8a45
6 changed files with 27 additions and 20 deletions

View File

@@ -70,7 +70,7 @@ CREATE TABLE products (
cumulate_min_stock_amount_of_sub_products TINYINT DEFAULT 0,
due_type TINYINT NOT NULL DEFAULT 1 CHECK(due_type IN (1, 2)),
quick_consume_amount REAL NOT NULL DEFAULT 1,
show_on_stock_overview TINYINT NOT NULL DEFAULT 1 CHECK(show_on_stock_overview IN (0, 1)),
hide_on_stock_overview TINYINT NOT NULL DEFAULT 0 CHECK(hide_on_stock_overview IN (0, 1)),
row_created_timestamp DATETIME DEFAULT (datetime('now', 'localtime'))
);

View File

@@ -38,7 +38,7 @@ FROM (
) sc
LEFT JOIN products p
ON sc.product_id = p.id
WHERE p.show_on_stock_overview = 1;
WHERE p.hide_on_stock_overview = 0;
CREATE VIEW uihelper_stock_current_overview
AS
@@ -80,4 +80,4 @@ FROM (
) sc
LEFT JOIN products p
ON sc.product_id = p.id
WHERE p.show_on_stock_overview = 1;
WHERE p.hide_on_stock_overview = 0;

View File

@@ -44,7 +44,7 @@ LEFT JOIN products_last_purchased plp
ON sc.product_id = plp.product_id
LEFT JOIN products p
ON sc.product_id = p.id
WHERE p.show_on_stock_overview = 1;
WHERE p.hide_on_stock_overview = 0;
DROP VIEW uihelper_stock_current_overview;
CREATE VIEW uihelper_stock_current_overview
@@ -92,4 +92,4 @@ LEFT JOIN products_last_purchased plp
ON sc.product_id = plp.product_id
LEFT JOIN products p
ON sc.product_id = p.id
WHERE p.show_on_stock_overview = 1;
WHERE p.hide_on_stock_overview = 0;