From 02d89e5774f69a44c3cb35e267e9618ab48b178c Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 24 Nov 2021 08:51:07 +0100 Subject: [PATCH 1/6] feat(item): add field genericFk in basic-data --- modules/entry/front/buy/import/index.js | 2 +- modules/item/back/models/item.json | 9 ++ modules/item/front/basic-data/index.html | 111 ++++++++++++++++++++ modules/item/front/basic-data/index.js | 59 +++++++++++ modules/item/front/basic-data/locale/es.yml | 3 +- 5 files changed, 182 insertions(+), 2 deletions(-) diff --git a/modules/entry/front/buy/import/index.js b/modules/entry/front/buy/import/index.js index 2f13b27460..a884762409 100644 --- a/modules/entry/front/buy/import/index.js +++ b/modules/entry/front/buy/import/index.js @@ -133,7 +133,7 @@ class Controller extends Section { case 'producerFk': case 'typeFk': case 'size': - case 'ink': + case 'inkFk': where[key] = value; } } diff --git a/modules/item/back/models/item.json b/modules/item/back/models/item.json index fd4b6b0794..d78e929ed4 100644 --- a/modules/item/back/models/item.json +++ b/modules/item/back/models/item.json @@ -143,6 +143,10 @@ }, "isFloramondo": { "type": "boolean" + }, + "genericFk": { + "type": "number", + "description": "Generic item" } }, "relations": { @@ -176,6 +180,11 @@ "model": "Expense", "foreignKey": "expenseFk" }, + "id": { + "type": "belongsTo", + "model": "Item", + "foreignKey": "genericFk" + }, "tags": { "type": "hasMany", "model": "ItemTag", diff --git a/modules/item/front/basic-data/index.html b/modules/item/front/basic-data/index.html index cec7a063f8..02dd08ebcb 100644 --- a/modules/item/front/basic-data/index.html +++ b/modules/item/front/basic-data/index.html @@ -137,6 +137,27 @@ ng-model="$ctrl.item.compression" rule> + + + {{::id}} - {{::name}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ID + Item + Size + Producer + Color + + + + + + + {{::item.id}} + + + {{::item.name}} + {{::item.size}} + {{::item.producer.name}} + {{::item.ink.name}} + + + + + + + \ No newline at end of file diff --git a/modules/item/front/basic-data/index.js b/modules/item/front/basic-data/index.js index 1a256c65bd..f37836fc8b 100644 --- a/modules/item/front/basic-data/index.js +++ b/modules/item/front/basic-data/index.js @@ -17,6 +17,65 @@ class Controller extends Section { return this.$http.patch(query, this.newIntrastat) .then(res => this.item.intrastatFk = res.data.id); } + + itemSearchFunc($search) { + return /^\d+$/.test($search) + ? {id: $search} + : {name: {like: '%' + $search + '%'}}; + } + + showFilterDialog(item) { + this.activeItem = item; + this.itemFilterParams = {}; + this.itemFilter = { + include: [ + { + relation: 'producer', + scope: { + fields: ['name'] + } + }, + { + relation: 'ink', + scope: { + fields: ['name'] + } + } + ] + }; + + this.$.filterDialog.show(); + } + + selectItem(id) { + this.activeItem['id'] = id; + this.$.filterDialog.hide(); + } + + filter() { + const filter = this.itemFilter; + const params = this.itemFilterParams; + const where = {}; + for (let key in params) { + const value = params[key]; + if (!value) continue; + + switch (key) { + case 'name': + where[key] = {like: `%${value}%`}; + break; + case 'producerFk': + case 'typeFk': + case 'size': + case 'inkFk': + where[key] = value; + } + } + + filter.where = where; + + this.$.itemsModel.applyFilter(filter); + } } ngModule.vnComponent('vnItemBasicData', { diff --git a/modules/item/front/basic-data/locale/es.yml b/modules/item/front/basic-data/locale/es.yml index 9fd3ca3c4d..d59752ebb1 100644 --- a/modules/item/front/basic-data/locale/es.yml +++ b/modules/item/front/basic-data/locale/es.yml @@ -10,4 +10,5 @@ New intrastat: Nuevo intrastat Identifier: Identificador Fragile: Frágil Is shown at website, app that this item cannot travel (wreath, palms, ...): Se muestra en la web, app que este artículo no puede viajar (coronas, palmas, ...) -Multiplier: Multiplicador \ No newline at end of file +Multiplier: Multiplicador +Generic: Genérico \ No newline at end of file -- 2.40.1 From 5931692fac54f1d8c89ccb9e9f42d134ac1372c5 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 24 Nov 2021 09:21:41 +0100 Subject: [PATCH 2/6] test(item_basic-data): add genericFk e2e --- db/dump/fixtures.sql | 37 +++++++++++++------------ e2e/helpers/selectors.js | 1 + e2e/paths/04-item/02_basic_data.spec.js | 25 +++++++++++------ 3 files changed, 37 insertions(+), 26 deletions(-) diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index dd21ca847e..c2879e26de 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -796,25 +796,26 @@ INSERT INTO `vn`.`itemFamily`(`code`, `description`) ('SER', 'Services'), ('VT', 'Sales'); -INSERT INTO `vn`.`item`(`id`, `typeFk`, `size`, `inkFk`, `stems`, `originFk`, `description`, `producerFk`, `intrastatFk`, `expenceFk`, `comment`, `relevancy`, `image`, `subName`, `minPrice`, `stars`, `family`, `isFloramondo`) +INSERT INTO `vn`.`item`(`id`, `typeFk`, `size`, `inkFk`, `stems`, `originFk`, `description`, `producerFk`, `intrastatFk`, + `expenceFk`, `comment`, `relevancy`, `image`, `subName`, `minPrice`, `stars`, `family`, `isFloramondo, genericFk`) VALUES - (1, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '1', NULL, 0, 1, 'VT', 0), - (2, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '2', NULL, 0, 2, 'VT', 0), - (3, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '3', NULL, 0, 5, 'VT', 0), - (4, 1, 60, 'YEL', 1, 1, 'Increases block', 1, 05080000, 4751000000, NULL, 0, '4', NULL, 0, 3, 'VT', 0), - (5, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '5', NULL, 0, 3, 'VT', 0), - (6, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '6', NULL, 0, 4, 'VT', 0), - (7, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '7', NULL, 0, 4, 'VT', 0), - (8, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '8', NULL, 0, 5, 'VT', 0), - (9, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '9', NULL, 0, 4, 'VT', 1), - (10, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '10', NULL, 0, 4, 'VT', 0), - (11, 1, 60, 'YEL', 1, 1, NULL, 1, 05080000, 4751000000, NULL, 0, '11', NULL, 0, 4, 'VT', 0), - (12, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '12', NULL, 0, 3, 'VT', 0), - (13, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '13', NULL, 0, 2, 'VT', 1), - (14, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 4, 'VT', 1), - (15, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0), - (16, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0), - (71, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'VT', 0); + (9, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '9', NULL, 0, 4, 'VT', 1, NULL), + (2, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '2', NULL, 0, 2, 'VT', 0, 9), + (3, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '3', NULL, 0, 5, 'VT', 0, NULL), + (1, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '1', NULL, 0, 1, 'VT', 0, NULL), + (4, 1, 60, 'YEL', 1, 1, 'Increases block', 1, 05080000, 4751000000, NULL, 0, '4', NULL, 0, 3, 'VT', 0, NULL), + (5, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '5', NULL, 0, 3, 'VT', 0, NULL), + (6, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '6', NULL, 0, 4, 'VT', 0, NULL), + (7, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '7', NULL, 0, 4, 'VT', 0, NULL), + (8, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '8', NULL, 0, 5, 'VT', 0, NULL), + (10, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '10', NULL, 0, 4, 'VT', 0, NULL), + (11, 1, 60, 'YEL', 1, 1, NULL, 1, 05080000, 4751000000, NULL, 0, '11', NULL, 0, 4, 'VT', 0, NULL), + (12, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '12', NULL, 0, 3, 'VT', 0, NULL), + (13, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '13', NULL, 0, 2, 'VT', 1, NULL), + (14, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 4, 'VT', 1, NULL), + (15, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0, NULL), + (16, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0, NULL), + (71, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'VT', 0, NULL); -- Update the taxClass after insert of the items UPDATE `vn`.`itemTaxCountry` SET `taxClassFk` = 2 diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index d8ebaa069e..b95ecbd7f1 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -382,6 +382,7 @@ export default { relevancy: 'vn-item-basic-data vn-input-number[ng-model="$ctrl.item.relevancy"]', origin: 'vn-autocomplete[ng-model="$ctrl.item.originFk"]', compression: 'vn-item-basic-data vn-input-number[ng-model="$ctrl.item.compression"]', + generic: 'vn-autocomplete[ng-model="$ctrl.item.genericFk"]', isFragile: 'vn-check[ng-model="$ctrl.item.isFragile"]', longName: 'vn-textfield[ng-model="$ctrl.item.longName"]', isActiveCheckbox: 'vn-check[label="Active"]', diff --git a/e2e/paths/04-item/02_basic_data.spec.js b/e2e/paths/04-item/02_basic_data.spec.js index defefe2796..ff3bda13f1 100644 --- a/e2e/paths/04-item/02_basic_data.spec.js +++ b/e2e/paths/04-item/02_basic_data.spec.js @@ -1,7 +1,7 @@ import selectors from '../../helpers/selectors.js'; import getBrowser from '../../helpers/puppeteer'; -describe('Item Edit basic data path', () => { +fdescribe('Item Edit basic data path', () => { let browser; let page; beforeAll(async() => { @@ -23,15 +23,17 @@ describe('Item Edit basic data path', () => { it(`should edit the item basic data`, async() => { await page.clearInput(selectors.itemBasicData.name); await page.write(selectors.itemBasicData.name, 'Rose of Purity'); - await page.autocompleteSearch(selectors.itemBasicData.type, 'Anthurium'); - await page.autocompleteSearch(selectors.itemBasicData.intrastat, 'Coral y materiales similares'); - await page.clearInput(selectors.itemBasicData.relevancy); - await page.write(selectors.itemBasicData.relevancy, '1'); - await page.autocompleteSearch(selectors.itemBasicData.origin, 'Spain'); - await page.clearInput(selectors.itemBasicData.compression); - await page.write(selectors.itemBasicData.compression, '2'); await page.clearInput(selectors.itemBasicData.longName); await page.write(selectors.itemBasicData.longName, 'RS Rose of Purity'); + await page.autocompleteSearch(selectors.itemBasicData.type, 'Anthurium'); + await page.autocompleteSearch(selectors.itemBasicData.intrastat, 'Coral y materiales similares'); + await page.autocompleteSearch(selectors.itemBasicData.origin, 'Spain'); + await page.clearInput(selectors.itemBasicData.relevancy); + await page.write(selectors.itemBasicData.relevancy, '1'); + await page.clearInput(selectors.itemBasicData.compression); + await page.write(selectors.itemBasicData.compression, '2'); + await page.clearInput(selectors.itemBasicData.generic); + await page.autocompleteSearch(selectors.itemBasicData.generic, '9'); await page.waitToClick(selectors.itemBasicData.isActiveCheckbox); await page.waitToClick(selectors.itemBasicData.priceInKgCheckbox); await page.waitToClick(selectors.itemBasicData.isFragile); @@ -101,6 +103,13 @@ describe('Item Edit basic data path', () => { expect(result).toEqual('2'); }); + it(`should confirm the item generic was edited`, async() => { + const result = await page + .waitToGetProperty(selectors.itemBasicData.generic, 'value'); + + expect(result).toEqual('9 - Melee Reinforced weapon combat fist 15cm'); + }); + it(`should confirm the item long name was edited`, async() => { const result = await page .waitToGetProperty(selectors.itemBasicData.longName, 'value'); -- 2.40.1 From eea94136288f49e02f03f8ad2479264d451ffd5c Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 26 Nov 2021 08:34:32 +0100 Subject: [PATCH 3/6] fix(item_basic-data): controller, test e2e and model --- db/dump/fixtures.sql | 45 +++++++++++++----------- e2e/paths/04-item/02_basic_data.spec.js | 6 ++-- modules/item/back/models/item.json | 6 +--- modules/item/front/basic-data/index.html | 2 ++ modules/item/front/basic-data/index.js | 2 +- 5 files changed, 32 insertions(+), 29 deletions(-) diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index c2879e26de..4eb97cf500 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -796,31 +796,32 @@ INSERT INTO `vn`.`itemFamily`(`code`, `description`) ('SER', 'Services'), ('VT', 'Sales'); -INSERT INTO `vn`.`item`(`id`, `typeFk`, `size`, `inkFk`, `stems`, `originFk`, `description`, `producerFk`, `intrastatFk`, - `expenceFk`, `comment`, `relevancy`, `image`, `subName`, `minPrice`, `stars`, `family`, `isFloramondo, genericFk`) +INSERT INTO `vn`.`item`(`id`, `typeFk`, `size`, `inkFk`, `stems`, `originFk`, `description`, `producerFk`, `intrastatFk`, `expenceFk`, + `comment`, `relevancy`, `image`, `subName`, `minPrice`, `stars`, `family`, `isFloramondo`, `genericFk`) VALUES - (9, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '9', NULL, 0, 4, 'VT', 1, NULL), - (2, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '2', NULL, 0, 2, 'VT', 0, 9), - (3, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '3', NULL, 0, 5, 'VT', 0, NULL), - (1, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '1', NULL, 0, 1, 'VT', 0, NULL), - (4, 1, 60, 'YEL', 1, 1, 'Increases block', 1, 05080000, 4751000000, NULL, 0, '4', NULL, 0, 3, 'VT', 0, NULL), - (5, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '5', NULL, 0, 3, 'VT', 0, NULL), - (6, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '6', NULL, 0, 4, 'VT', 0, NULL), - (7, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '7', NULL, 0, 4, 'VT', 0, NULL), - (8, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '8', NULL, 0, 5, 'VT', 0, NULL), - (10, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '10', NULL, 0, 4, 'VT', 0, NULL), - (11, 1, 60, 'YEL', 1, 1, NULL, 1, 05080000, 4751000000, NULL, 0, '11', NULL, 0, 4, 'VT', 0, NULL), - (12, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '12', NULL, 0, 3, 'VT', 0, NULL), - (13, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '13', NULL, 0, 2, 'VT', 1, NULL), - (14, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 4, 'VT', 1, NULL), - (15, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0, NULL), - (16, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0, NULL), - (71, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'VT', 0, NULL); + (1, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '1', NULL, 0, 1, 'VT', 0, NULL), + (2, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '2', NULL, 0, 2, 'VT', 0, NULL), + (3, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '3', NULL, 0, 5, 'VT', 0, NULL), + (4, 1, 60, 'YEL', 1, 1, 'Increases block', 1, 05080000, 4751000000, NULL, 0, '4', NULL, 0, 3, 'VT', 0, NULL), + (5, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '5', NULL, 0, 3, 'VT', 0, NULL), + (6, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '6', NULL, 0, 4, 'VT', 0, NULL), + (7, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '7', NULL, 0, 4, 'VT', 0, NULL), + (8, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '8', NULL, 0, 5, 'VT', 0, NULL), + (9, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '9', NULL, 0, 4, 'VT', 1, NULL), + (10, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '10', NULL, 0, 4, 'VT', 0, NULL), + (11, 1, 60, 'YEL', 1, 1, NULL, 1, 05080000, 4751000000, NULL, 0, '11', NULL, 0, 4, 'VT', 0, NULL), + (12, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '12', NULL, 0, 3, 'VT', 0, NULL), + (13, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '13', NULL, 0, 2, 'VT', 1, NULL), + (14, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 4, 'VT', 1, NULL), + (15, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0, NULL), + (16, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0, NULL), + (71, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'VT', 0, NULL); -- Update the taxClass after insert of the items UPDATE `vn`.`itemTaxCountry` SET `taxClassFk` = 2 WHERE `itemFk` IN(4, 5, 6, 7, 11, 12, 13, 14, 15, 16, 71); + INSERT INTO `vn`.`priceFixed`(`id`, `itemFk`, `rate0`, `rate1`, `rate2`, `rate3`, `started`, `ended`, `bonus`, `warehouseFk`, `created`) VALUES (1, 1, 0, 0, 2.5, 2, CURDATE(), DATE_ADD(CURDATE(), INTERVAL +1 MONTH), 0, 1, CURDATE()), @@ -2419,4 +2420,8 @@ INSERT INTO `vn`.`expeditionScan` (`id`, `expeditionFk`, `scanned`, `palletFk`) (9, 9, CURDATE(), 1), (10, 10, CURDATE(), 1); -CALL `cache`.`last_buy_refresh`(FALSE); \ No newline at end of file +CALL `cache`.`last_buy_refresh`(FALSE); + +-- Update the genericFk after insert of the items + UPDATE `vn`.`item` SET `genericFk` = 9 + WHERE `id` = 2; \ No newline at end of file diff --git a/e2e/paths/04-item/02_basic_data.spec.js b/e2e/paths/04-item/02_basic_data.spec.js index ff3bda13f1..0bbb6ad12c 100644 --- a/e2e/paths/04-item/02_basic_data.spec.js +++ b/e2e/paths/04-item/02_basic_data.spec.js @@ -1,7 +1,7 @@ import selectors from '../../helpers/selectors.js'; import getBrowser from '../../helpers/puppeteer'; -fdescribe('Item Edit basic data path', () => { +describe('Item Edit basic data path', () => { let browser; let page; beforeAll(async() => { @@ -33,7 +33,7 @@ fdescribe('Item Edit basic data path', () => { await page.clearInput(selectors.itemBasicData.compression); await page.write(selectors.itemBasicData.compression, '2'); await page.clearInput(selectors.itemBasicData.generic); - await page.autocompleteSearch(selectors.itemBasicData.generic, '9'); + await page.autocompleteSearch(selectors.itemBasicData.generic, '16'); await page.waitToClick(selectors.itemBasicData.isActiveCheckbox); await page.waitToClick(selectors.itemBasicData.priceInKgCheckbox); await page.waitToClick(selectors.itemBasicData.isFragile); @@ -107,7 +107,7 @@ fdescribe('Item Edit basic data path', () => { const result = await page .waitToGetProperty(selectors.itemBasicData.generic, 'value'); - expect(result).toEqual('9 - Melee Reinforced weapon combat fist 15cm'); + expect(result).toEqual('16 - Pallet'); }); it(`should confirm the item long name was edited`, async() => { diff --git a/modules/item/back/models/item.json b/modules/item/back/models/item.json index d78e929ed4..9b78264f78 100644 --- a/modules/item/back/models/item.json +++ b/modules/item/back/models/item.json @@ -143,10 +143,6 @@ }, "isFloramondo": { "type": "boolean" - }, - "genericFk": { - "type": "number", - "description": "Generic item" } }, "relations": { @@ -180,7 +176,7 @@ "model": "Expense", "foreignKey": "expenseFk" }, - "id": { + "generic": { "type": "belongsTo", "model": "Item", "foreignKey": "genericFk" diff --git a/modules/item/front/basic-data/index.html b/modules/item/front/basic-data/index.html index 02dd08ebcb..3bf1fc10b1 100644 --- a/modules/item/front/basic-data/index.html +++ b/modules/item/front/basic-data/index.html @@ -158,6 +158,8 @@ + + Date: Fri, 26 Nov 2021 08:40:20 +0100 Subject: [PATCH 4/6] remove unnecessary intro and comment --- db/dump/fixtures.sql | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 4eb97cf500..b480a6d787 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -821,7 +821,6 @@ INSERT INTO `vn`.`item`(`id`, `typeFk`, `size`, `inkFk`, `stems`, `originFk`, `d UPDATE `vn`.`itemTaxCountry` SET `taxClassFk` = 2 WHERE `itemFk` IN(4, 5, 6, 7, 11, 12, 13, 14, 15, 16, 71); - INSERT INTO `vn`.`priceFixed`(`id`, `itemFk`, `rate0`, `rate1`, `rate2`, `rate3`, `started`, `ended`, `bonus`, `warehouseFk`, `created`) VALUES (1, 1, 0, 0, 2.5, 2, CURDATE(), DATE_ADD(CURDATE(), INTERVAL +1 MONTH), 0, 1, CURDATE()), @@ -2422,6 +2421,5 @@ INSERT INTO `vn`.`expeditionScan` (`id`, `expeditionFk`, `scanned`, `palletFk`) CALL `cache`.`last_buy_refresh`(FALSE); --- Update the genericFk after insert of the items - UPDATE `vn`.`item` SET `genericFk` = 9 - WHERE `id` = 2; \ No newline at end of file +UPDATE `vn`.`item` SET `genericFk` = 9 + WHERE `id` = 2; \ No newline at end of file -- 2.40.1 From 8bd1db2e97bc57c4c57eac5b3170c9f65acdd9f8 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 29 Nov 2021 10:10:53 +0100 Subject: [PATCH 5/6] remove unnecesary on-accept --- modules/entry/front/buy/import/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/entry/front/buy/import/index.js b/modules/entry/front/buy/import/index.js index a884762409..2f13b27460 100644 --- a/modules/entry/front/buy/import/index.js +++ b/modules/entry/front/buy/import/index.js @@ -133,7 +133,7 @@ class Controller extends Section { case 'producerFk': case 'typeFk': case 'size': - case 'inkFk': + case 'ink': where[key] = value; } } -- 2.40.1 From 49e9fcaa7ccbdfc0e149e2bca6e284de05ed4d93 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 29 Nov 2021 10:11:47 +0100 Subject: [PATCH 6/6] remove unnecesary on-accept --- modules/entry/front/buy/import/index.html | 1 - modules/entry/front/buy/import/index.js | 2 +- modules/item/front/basic-data/index.html | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/entry/front/buy/import/index.html b/modules/entry/front/buy/import/index.html index ada92fcc32..154e74ffc2 100644 --- a/modules/entry/front/buy/import/index.html +++ b/modules/entry/front/buy/import/index.html @@ -113,7 +113,6 @@ diff --git a/modules/entry/front/buy/import/index.js b/modules/entry/front/buy/import/index.js index 2f13b27460..a884762409 100644 --- a/modules/entry/front/buy/import/index.js +++ b/modules/entry/front/buy/import/index.js @@ -133,7 +133,7 @@ class Controller extends Section { case 'producerFk': case 'typeFk': case 'size': - case 'ink': + case 'inkFk': where[key] = value; } } diff --git a/modules/item/front/basic-data/index.html b/modules/item/front/basic-data/index.html index 3bf1fc10b1..e926e3180e 100644 --- a/modules/item/front/basic-data/index.html +++ b/modules/item/front/basic-data/index.html @@ -230,7 +230,6 @@ -- 2.40.1