diff --git a/controllers/StockController.php b/controllers/StockController.php index 31f6b79b..dcbcb635 100644 --- a/controllers/StockController.php +++ b/controllers/StockController.php @@ -187,7 +187,7 @@ class StockController extends BaseController 'products' => $this->getDatabase()->products()->where('id != :1 AND parent_product_id IS NULL and active = 1', $product->id)->orderBy('name', 'COLLATE NOCASE'), 'isSubProductOfOthers' => $this->getDatabase()->products()->where('parent_product_id = :1', $product->id)->count() !== 0, 'mode' => 'edit', - 'quConversions' => $this->getDatabase()->quantity_unit_conversions(), + 'quConversions' => $this->getDatabase()->quantity_unit_conversions()->where('product_id', $product->id), 'productBarcodeUserfields' => $this->getUserfieldsService()->GetFields('product_barcodes'), 'productBarcodeUserfieldValues' => $this->getUserfieldsService()->GetAllValues('product_barcodes') ]); diff --git a/localization/demo_data.pot b/localization/demo_data.pot index 49609b81..af73fbc8 100644 --- a/localization/demo_data.pot +++ b/localization/demo_data.pot @@ -380,3 +380,8 @@ msgstr "" msgid "Ukrainian" msgstr "" + +msgid "Kilogram" +msgid_plural "Kilograms" +msgstr[0] "" +msgstr[1] "" diff --git a/localization/strings.pot b/localization/strings.pot index ef2ace76..384d666a 100644 --- a/localization/strings.pot +++ b/localization/strings.pot @@ -1217,9 +1217,6 @@ msgstr "" msgid "QU conversions" msgstr "" -msgid "Product overrides" -msgstr "" - msgid "Override for product" msgstr "" @@ -2350,3 +2347,6 @@ msgstr "" msgid "QU conversions resolved" msgstr "" + +msgid "Product specifc QU conversions" +msgstr "" diff --git a/public/viewjs/productform.js b/public/viewjs/productform.js index 38effcb1..63521519 100644 --- a/public/viewjs/productform.js +++ b/public/viewjs/productform.js @@ -293,16 +293,10 @@ $("#delete-current-product-picture-button").on("click", function(e) var quConversionsTable = $('#qu-conversions-table-products').DataTable({ 'order': [[1, 'asc']], - "orderFixed": [[4, 'asc']], 'columnDefs': [ { 'orderable': false, 'targets': 0 }, - { 'searchable': false, "targets": 0 }, - { 'visible': false, 'targets': 4 } - ].concat($.fn.dataTable.defaults.columnDefs), - 'rowGroup': { - enable: true, - dataSrc: 4 - } + { 'searchable': false, "targets": 0 } + ].concat($.fn.dataTable.defaults.columnDefs) }); $('#qu-conversions-table-products tbody').removeClass("d-none"); quConversionsTable.columns.adjust().draw(); diff --git a/services/DemoDataGeneratorService.php b/services/DemoDataGeneratorService.php index d9da4768..4c6cd484 100644 --- a/services/DemoDataGeneratorService.php +++ b/services/DemoDataGeneratorService.php @@ -65,6 +65,8 @@ class DemoDataGeneratorService extends BaseService INSERT INTO quantity_units (id, name, name_plural) VALUES (11, '{$this->__n_sql(1, 'Milliliter', 'Milliliters')}', '{$this->__n_sql(2, 'Milliliter', 'Milliliters')}'); --11 DELETE FROM quantity_units WHERE name = '{$this->__t_sql('Slice')}'; INSERT INTO quantity_units (id, name, name_plural) VALUES (12, '{$this->__n_sql(1, 'Slice', 'Slices')}', '{$this->__n_sql(2, 'Slice', 'Slices')}'); --12 + DELETE FROM quantity_units WHERE name = '{$this->__t_sql('Kilogram')}'; + INSERT INTO quantity_units (id, name, name_plural) VALUES (13, '{$this->__n_sql(1, 'Kilogram', 'Kilograms')}', '{$this->__n_sql(2, 'Kilogram', 'Kilograms')}'); --13 INSERT INTO product_groups(name) VALUES ('01 {$this->__t_sql('Sweets')}'); --1 INSERT INTO product_groups(name) VALUES ('02 {$this->__t_sql('Bakery products')}'); --2 @@ -112,6 +114,8 @@ class DemoDataGeneratorService extends BaseService INSERT INTO quantity_unit_conversions (from_qu_id, to_qu_id, factor, product_id) VALUES (3, 12, 10, 10); INSERT INTO quantity_unit_conversions (from_qu_id, to_qu_id, factor, product_id) VALUES (3, 8, 1000, 22); + INSERT INTO quantity_unit_conversions (from_qu_id, to_qu_id, factor) VALUES (13, 8, 1000); + INSERT INTO quantity_unit_conversions (from_qu_id, to_qu_id, factor) VALUES (9, 11, 1000); INSERT INTO shopping_list (note, amount) VALUES ('{$this->__t_sql('Some good snacks')}', 1); INSERT INTO shopping_list (product_id, amount) VALUES (20, 1); diff --git a/views/productform.blade.php b/views/productform.blade.php index 013f8fcf..4b182000 100644 --- a/views/productform.blade.php +++ b/views/productform.blade.php @@ -706,7 +706,7 @@