diff --git a/changelog/62_UNRELEASED_xxxx-xx-xx.md b/changelog/62_UNRELEASED_xxxx-xx-xx.md index 816accd6..362cf26a 100644 --- a/changelog/62_UNRELEASED_xxxx-xx-xx.md +++ b/changelog/62_UNRELEASED_xxxx-xx-xx.md @@ -30,6 +30,7 @@ - On the stock overview page it's now also possible to search/filter by product barcodes (via the general search field) - The product picker on the consume page now only shows products which are currently in stock - Added a filter option to only show in-stock products on the products list page (master data) +- Added new columns on the stock overview page (hidden by default): Product description, product default location, parent product - Fixed that editing stock entries was not possible - Fixed that consuming with Scan Mode was not possible - Fixed that the current stock total value (header of the stock overview page) didn't include decimal amounts (thanks @Ape) diff --git a/migrations/0136.sql b/migrations/0136.sql index 975e6cc2..6464fe02 100644 --- a/migrations/0136.sql +++ b/migrations/0136.sql @@ -14,7 +14,7 @@ SELECT (SELECT name FROM quantity_units WHERE quantity_units.id = p.qu_id_stock) AS qu_unit_name, (SELECT name_plural FROM quantity_units WHERE quantity_units.id = p.qu_id_stock) AS qu_unit_name_plural, p.name AS product_name, - (SELECT name FROM product_groups WHERE product_groups.id = product_group_id) AS product_group_name, + (SELECT name FROM product_groups WHERE product_groups.id = p.product_group_id) AS product_group_name, EXISTS(SELECT * FROM shopping_list WHERE shopping_list.product_id = sc.product_id) AS on_shopping_list, (SELECT name FROM quantity_units WHERE quantity_units.id = p.qu_id_purchase) AS qu_purchase_unit_name, (SELECT name_plural FROM quantity_units WHERE quantity_units.id = p.qu_id_purchase) AS qu_purchase_unit_name_plural, @@ -30,7 +30,10 @@ SELECT plp.price AS last_price, p.min_stock_amount, pbcs.barcodes AS product_barcodes, - p.description as product_description + p.description as product_description, + l.name AS product_default_location_name, + p_parent.id AS parent_product_id, + p_parent.name AS parent_product_name FROM ( SELECT * FROM stock_current @@ -48,6 +51,10 @@ LEFT JOIN products p ON sc.product_id = p.id LEFT JOIN product_barcodes_comma_separated pbcs ON sc.product_id = pbcs.product_id +LEFT JOIN products p_parent + ON p.parent_product_id = p_parent.id +LEFT JOIN locations l + ON p.location_id = l.id WHERE p.hide_on_stock_overview = 0; DROP VIEW uihelper_stock_current_overview; @@ -66,7 +73,7 @@ SELECT (SELECT name FROM quantity_units WHERE quantity_units.id = p.qu_id_stock) AS qu_unit_name, (SELECT name_plural FROM quantity_units WHERE quantity_units.id = p.qu_id_stock) AS qu_unit_name_plural, p.name AS product_name, - (SELECT name FROM product_groups WHERE product_groups.id = product_group_id) AS product_group_name, + (SELECT name FROM product_groups WHERE product_groups.id = p.product_group_id) AS product_group_name, EXISTS(SELECT * FROM shopping_list WHERE shopping_list.product_id = sc.product_id) AS on_shopping_list, (SELECT name FROM quantity_units WHERE quantity_units.id = p.qu_id_purchase) AS qu_purchase_unit_name, (SELECT name_plural FROM quantity_units WHERE quantity_units.id = p.qu_id_purchase) AS qu_purchase_unit_name_plural, @@ -82,7 +89,10 @@ SELECT plp.price AS last_price, p.min_stock_amount, pbcs.barcodes AS product_barcodes, - p.description as product_description + p.description AS product_description, + l.name AS product_default_location_name, + p_parent.id AS parent_product_id, + p_parent.name AS parent_product_name FROM ( SELECT * FROM stock_current @@ -100,4 +110,8 @@ LEFT JOIN products p ON sc.product_id = p.id LEFT JOIN product_barcodes_comma_separated pbcs ON sc.product_id = pbcs.product_id +LEFT JOIN products p_parent + ON p.parent_product_id = p_parent.id +LEFT JOIN locations l + ON p.location_id = l.id WHERE p.hide_on_stock_overview = 0; diff --git a/public/viewjs/stockoverview.js b/public/viewjs/stockoverview.js index 7530b15d..d4df0095 100755 --- a/public/viewjs/stockoverview.js +++ b/public/viewjs/stockoverview.js @@ -15,6 +15,8 @@ { 'visible': false, 'targets': 12 }, { 'visible': false, 'targets': 13 }, { 'visible': false, 'targets': 14 }, + { 'visible': false, 'targets': 15 }, + { 'visible': false, 'targets': 16 }, { "type": "num", "targets": 3 }, { "type": "html-num-fmt", "targets": 9 }, { "type": "html-num-fmt", "targets": 10 }, diff --git a/views/stockoverview.blade.php b/views/stockoverview.blade.php index c274964c..da37117d 100755 --- a/views/stockoverview.blade.php +++ b/views/stockoverview.blade.php @@ -170,6 +170,8 @@