diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index dd21ca847..b480a6d78 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); + (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 @@ -2418,4 +2419,7 @@ 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 `vn`.`item` SET `genericFk` = 9 + WHERE `id` = 2; \ No newline at end of file diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index d8ebaa069..b95ecbd7f 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 defefe279..0bbb6ad12 100644 --- a/e2e/paths/04-item/02_basic_data.spec.js +++ b/e2e/paths/04-item/02_basic_data.spec.js @@ -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, '16'); 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('16 - Pallet'); + }); + it(`should confirm the item long name was edited`, async() => { const result = await page .waitToGetProperty(selectors.itemBasicData.longName, 'value'); diff --git a/front/core/styles/icons/salixfont.css b/front/core/styles/icons/salixfont.css index 28c81552e..3ca829282 100644 --- a/front/core/styles/icons/salixfont.css +++ b/front/core/styles/icons/salixfont.css @@ -71,7 +71,7 @@ } .icon-bucket:before { content: "\e90e"; - color: #5f5f5f; + color: #000; } .icon-buscaman:before { content: "\e90f"; @@ -204,7 +204,7 @@ .icon-headercol:before { content: "\e936"; } -.icon-History:before { +.icon-history:before { content: "\e937"; } .icon-Inactivo:before { @@ -219,13 +219,13 @@ .icon-invoice:before { content: "\e93b"; } -.icon-invoiceIn:before { +.icon-invoice-in:before { content: "\e93c"; } .icon-invoice-in-create:before { content: "\e93d"; } -.icon-invoiceOut:before { +.icon-invoice-out:before { content: "\e93e"; } .icon-item:before { @@ -234,7 +234,7 @@ .icon-languaje:before { content: "\e940"; } -.icon-lineas:before { +.icon-lines:before { content: "\e941"; } .icon-linesprepaired:before { @@ -342,9 +342,6 @@ .icon-splur:before { content: "\e963"; } -.icon-stowaway-2:before { - content: "\e964"; -} .icon-supplier:before { content: "\e965"; } diff --git a/front/core/styles/icons/salixfont.svg b/front/core/styles/icons/salixfont.svg index e4fe2300b..109886300 100644 --- a/front/core/styles/icons/salixfont.svg +++ b/front/core/styles/icons/salixfont.svg @@ -62,17 +62,17 @@ - + - + - + - + @@ -107,7 +107,6 @@ - diff --git a/modules/entry/front/buy/import/index.html b/modules/entry/front/buy/import/index.html index ada92fcc3..154e74ffc 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 2f13b2746..a88476240 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/invoiceIn/front/descriptor/index.html b/modules/invoiceIn/front/descriptor/index.html index 6829a0daf..0cdd5f8b8 100644 --- a/modules/invoiceIn/front/descriptor/index.html +++ b/modules/invoiceIn/front/descriptor/index.html @@ -43,7 +43,7 @@
+ icon="icon-invoice-in">
diff --git a/modules/invoiceIn/front/routes.json b/modules/invoiceIn/front/routes.json index 599e6cb2d..bae496629 100644 --- a/modules/invoiceIn/front/routes.json +++ b/modules/invoiceIn/front/routes.json @@ -1,7 +1,7 @@ { "module": "invoiceIn", "name": "Invoices in", - "icon": "icon-invoiceIn", + "icon": "icon-invoice-in", "validations": true, "dependencies": [ "worker", @@ -11,7 +11,7 @@ "main": [ { "state": "invoiceIn.index", - "icon": "icon-invoiceIn" + "icon": "icon-invoice-in" } ], "card": [ diff --git a/modules/invoiceOut/front/routes.json b/modules/invoiceOut/front/routes.json index 5cb2a780c..09d9f3d33 100644 --- a/modules/invoiceOut/front/routes.json +++ b/modules/invoiceOut/front/routes.json @@ -1,12 +1,12 @@ { "module": "invoiceOut", "name": "Invoices out", - "icon": "icon-invoiceOut", + "icon": "icon-invoice-out", "validations" : true, "dependencies": ["worker", "client", "ticket"], "menus": { "main": [ - {"state": "invoiceOut.index", "icon": "icon-invoiceOut"} + {"state": "invoiceOut.index", "icon": "icon-invoice-out"} ] }, "routes": [ diff --git a/modules/item/back/models/item.json b/modules/item/back/models/item.json index fd4b6b079..9b78264f7 100644 --- a/modules/item/back/models/item.json +++ b/modules/item/back/models/item.json @@ -176,6 +176,11 @@ "model": "Expense", "foreignKey": "expenseFk" }, + "generic": { + "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 cec7a063f..e926e3180 100644 --- a/modules/item/front/basic-data/index.html +++ b/modules/item/front/basic-data/index.html @@ -137,6 +137,29 @@ 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 1a256c65b..5a303f15f 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['genericFk'] = 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 9fd3ca3c4..d59752ebb 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 diff --git a/modules/item/front/routes.json b/modules/item/front/routes.json index 6d39083b4..9e21e1697 100644 --- a/modules/item/front/routes.json +++ b/modules/item/front/routes.json @@ -7,7 +7,7 @@ "menus": { "main": [ {"state": "item.index", "icon": "icon-item"}, - {"state": "item.request", "icon": "pan_tool"}, + {"state": "item.request", "icon": "icon-buyrequest"}, {"state": "item.waste.index", "icon": "icon-claims"}, {"state": "item.fixedPrice", "icon": "icon-fixedPrice"} ], diff --git a/modules/monitor/front/index/tickets/index.html b/modules/monitor/front/index/tickets/index.html index 34f2841fd..7c0eb83da 100644 --- a/modules/monitor/front/index/tickets/index.html +++ b/modules/monitor/front/index/tickets/index.html @@ -93,7 +93,7 @@ ng-show="::ticket.hasTicketRequest" translate-attr="{title: 'Purchase request'}" class="bright" - icon="icon-100"> + icon="icon-buyrequest"> { { relation: 'address', scope: { - fields: ['id', 'street', 'postalCode', 'city'], + fields: ['street', 'city', 'provinceFk', 'phone', 'nickname', 'postalCode'], + include: { + relation: 'province', + scope: { + fields: ['name'] + } + } } }, ] diff --git a/modules/route/front/tickets/index.html b/modules/route/front/tickets/index.html index 6329dbb1a..7d515b67c 100644 --- a/modules/route/front/tickets/index.html +++ b/modules/route/front/tickets/index.html @@ -142,10 +142,15 @@ Ticket Client - Packages - Warehouse - Postcode + Province + + + Population + + + PC Address + Warehouse @@ -165,10 +170,11 @@ {{::ticket.nickname}} - {{::ticket.packages}} - {{::ticket.warehouse.name}} + {{::ticket.address.province.name}} + {{::ticket.address.city}} {{::ticket.address.postalCode}} {{::ticket.address.street}} + {{::ticket.warehouse.name}} diff --git a/modules/route/front/tickets/locale/es.yml b/modules/route/front/tickets/locale/es.yml index 6fa29e5ca..d4ab440a7 100644 --- a/modules/route/front/tickets/locale/es.yml +++ b/modules/route/front/tickets/locale/es.yml @@ -10,4 +10,5 @@ Ticket not found: No se ha encontrado el ticket The selected ticket is not suitable for this route: El ticket seleccionado no es apto para esta ruta PC: CP The route's vehicle doesn't have a departing warehouse: El vehículo de la ruta no tiene un almacén de salida -The route doesn't have a vehicle: La ruta no tiene un vehículo \ No newline at end of file +The route doesn't have a vehicle: La ruta no tiene un vehículo +Population: Población \ No newline at end of file diff --git a/modules/ticket/front/index/index.html b/modules/ticket/front/index/index.html index 63b0b049d..096f57e05 100644 --- a/modules/ticket/front/index/index.html +++ b/modules/ticket/front/index/index.html @@ -49,7 +49,7 @@ ng-show="::ticket.hasTicketRequest" translate-attr="{title: 'Purchase request'}" class="bright" - icon="icon-100"> + icon="icon-buyrequest">