From d3852bac5d01a30625ed042c2c4c42292b73d90b Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 26 Jul 2022 11:45:12 +0200 Subject: [PATCH 01/14] fix(vnInputTime): quit new date(null) --- front/core/components/input-time/index.js | 9 ++++++--- modules/route/front/basic-data/index.html | 12 ++++++------ package.json | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/front/core/components/input-time/index.js b/front/core/components/input-time/index.js index d77ccbec2..0d01fbd32 100644 --- a/front/core/components/input-time/index.js +++ b/front/core/components/input-time/index.js @@ -23,12 +23,15 @@ export default class InputTime extends Field { let date = null; let value = this.input.value; + if (this.field && !this.modelDate) + this.modelDate = this.field; + if (value) { let split = value.split(':').map(i => parseInt(i) || null); - date = this.field instanceof Date - ? this.field - : new Date(this.field || null); + date = this.modelDate + ? new Date(this.modelDate) + : new Date(); date.setHours(split[0], split[1], 0, 0); } diff --git a/modules/route/front/basic-data/index.html b/modules/route/front/basic-data/index.html index d3ba25b11..737bbab13 100644 --- a/modules/route/front/basic-data/index.html +++ b/modules/route/front/basic-data/index.html @@ -21,7 +21,7 @@
{{name}} - {{nickname}}
- diff --git a/package.json b/package.json index 13a7096d6..82fc606d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-back", - "version": "8.6.0", + "version": "8.8.0", "author": "Verdnatura Levante SL", "description": "Salix backend", "license": "GPL-3.0", From 085a4537a8050ce5a9fb0ff7c4c58326016900fe Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 27 Jul 2022 11:16:33 +0200 Subject: [PATCH 02/14] jenkins try --- db/dump/structure.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/db/dump/structure.sql b/db/dump/structure.sql index 1f787f864..b9415f658 100644 --- a/db/dump/structure.sql +++ b/db/dump/structure.sql @@ -49732,6 +49732,7 @@ proc:BEGIN pb.m3 DESC LIMIT vMaxTicketPrinted; + -- Se seleccionan los primeros tickets, asignando colección para dejarlos bloqueados a otros sacadores. -- Se splitan los tickets preparables, para que solo tengan un tipo de empaquetado From 1e35663a96cb421b3fe6561aa76cda404cf3f4bb Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 27 Jul 2022 11:57:51 +0200 Subject: [PATCH 03/14] jenkins try --- db/dump/structure.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/db/dump/structure.sql b/db/dump/structure.sql index b900ce5c7..bb58c1955 100644 --- a/db/dump/structure.sql +++ b/db/dump/structure.sql @@ -49732,7 +49732,6 @@ proc:BEGIN pb.m3 DESC LIMIT vMaxTicketPrinted; - -- Se seleccionan los primeros tickets, asignando colección para dejarlos bloqueados a otros sacadores. -- Se splitan los tickets preparables, para que solo tengan un tipo de empaquetado From 5cf102c7fd006456da224168d99e8f283a9bdebb Mon Sep 17 00:00:00 2001 From: jgallego Date: Wed, 24 Aug 2022 14:13:26 +0200 Subject: [PATCH 04/14] sustituido density por weightByPiece --- .../back/methods/entry/editLatestBuys.js | 2 +- .../back/methods/entry/latestBuysFilter.js | 2 +- modules/entry/front/latest-buys/index.html | 6 ++-- modules/entry/front/latest-buys/index.js | 4 +-- modules/item/back/methods/item/filter.js | 2 +- modules/item/back/models/item.json | 4 +-- modules/item/front/basic-data/index.html | 5 ++- modules/item/front/index/index.html | 6 ++-- modules/item/front/index/index.js | 2 +- modules/item/front/locale/es.yml | 2 +- modules/item/front/summary/index.html | 4 +-- .../methods/travel/extraCommunityFilter.js | 14 ++++---- .../reports/extra-community/sql/entries.sql | 33 ++++++++++--------- .../reports/extra-community/sql/travels.sql | 4 +-- 14 files changed, 46 insertions(+), 44 deletions(-) diff --git a/modules/entry/back/methods/entry/editLatestBuys.js b/modules/entry/back/methods/entry/editLatestBuys.js index 72bee98ae..2642d4f4d 100644 --- a/modules/entry/back/methods/entry/editLatestBuys.js +++ b/modules/entry/back/methods/entry/editLatestBuys.js @@ -52,7 +52,7 @@ module.exports = Self => { switch (field) { case 'size': - case 'density': + case 'weightByPiece': case 'description': case 'packingOut': modelName = 'Item'; diff --git a/modules/entry/back/methods/entry/latestBuysFilter.js b/modules/entry/back/methods/entry/latestBuysFilter.js index 9a21d4472..8972b4f5c 100644 --- a/modules/entry/back/methods/entry/latestBuysFilter.js +++ b/modules/entry/back/methods/entry/latestBuysFilter.js @@ -155,7 +155,7 @@ module.exports = Self => { i.image, i.id AS itemFk, i.size, - i.density, + i.weightByPiece, it.code, i.typeFk, i.family, diff --git a/modules/entry/front/latest-buys/index.html b/modules/entry/front/latest-buys/index.html index adeda5e56..16df3e926 100644 --- a/modules/entry/front/latest-buys/index.html +++ b/modules/entry/front/latest-buys/index.html @@ -67,8 +67,8 @@ Origin - - Density + + WeightByPiece Active @@ -181,7 +181,7 @@ {{::buy.intrastat}} {{::buy.origin}} - {{::buy.density}} + {{::buy.weightByPiece}} { i.subName, i.isActive, i.stems, - i.density, + i.weightByPiece, i.stemMultiplier, i.typeFk, i.isFloramondo, diff --git a/modules/item/back/models/item.json b/modules/item/back/models/item.json index 01b6ba093..704c97434 100644 --- a/modules/item/back/models/item.json +++ b/modules/item/back/models/item.json @@ -53,9 +53,9 @@ "type": "number", "description": "Relevancy" }, - "density": { + "weightByPiece": { "type": "number", - "description": "Density" + "description": "WeightByPiece" }, "stemMultiplier": { "type": "number", diff --git a/modules/item/front/basic-data/index.html b/modules/item/front/basic-data/index.html index 22fd33a07..2d608f505 100644 --- a/modules/item/front/basic-data/index.html +++ b/modules/item/front/basic-data/index.html @@ -124,9 +124,8 @@ Buyer - - Density + + WeightByPiece Multiplier @@ -117,7 +117,7 @@ {{::item.userName}} - {{::item.density}} + {{::item.weightByPiece}} {{::item.stemMultiplier}} - + diff --git a/modules/travel/back/methods/travel/extraCommunityFilter.js b/modules/travel/back/methods/travel/extraCommunityFilter.js index 7769b7f21..76e25a543 100644 --- a/modules/travel/back/methods/travel/extraCommunityFilter.js +++ b/modules/travel/back/methods/travel/extraCommunityFilter.js @@ -130,8 +130,8 @@ module.exports = Self => { SUM(b.stickers) AS stickers, s.id AS supplierFk, s.nickname AS cargoSupplierNickname, - CAST(SUM(i.density * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as loadedKg, - CAST(SUM(167.5 * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as volumeKg + CAST(SUM(b.weight * b.stickers) as DECIMAL(10,0)) as loadedKg, + CAST(SUM(vc.aerealVolumetricDensity * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000) as DECIMAL(10,0)) as volumeKg FROM travel t LEFT JOIN supplier s ON s.id = t.cargoSupplierFk LEFT JOIN entry e ON e.travelFk = t.id @@ -143,7 +143,8 @@ module.exports = Self => { JOIN warehouse wo ON wo.id = t.warehouseOutFk JOIN country c ON c.id = wo.countryFk LEFT JOIN continent cnt ON cnt.id = c.continentFk - JOIN agencyMode am ON am.id = t.agencyModeFk` + JOIN agencyMode am ON am.id = t.agencyModeFk + JOIN vn.volumeConfig vc` ); stmt.merge(conn.makeWhere(filter.where)); @@ -164,15 +165,16 @@ module.exports = Self => { SUM(b.stickers) AS stickers, e.evaNotes, e.notes, - CAST(SUM(i.density * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as loadedkg, - CAST(SUM(167.5 * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as volumeKg + CAST(SUM(b.weight * b.stickers) AS DECIMAL(10,0)) as loadedkg, + CAST(SUM(vc.aerealVolumetricDensity * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000) AS DECIMAL(10,0)) as volumeKg FROM tmp.travel tr JOIN entry e ON e.travelFk = tr.id JOIN buy b ON b.entryFk = e.id JOIN packaging pkg ON pkg.id = b.packageFk JOIN item i ON i.id = b.itemFk JOIN itemType it ON it.id = i.typeFk - JOIN supplier s ON s.id = e.supplierFk` + JOIN supplier s ON s.id = e.supplierFk + JOIN vn.volumeConfig vc` ); stmt.merge(conn.makeGroupBy('e.id')); diff --git a/print/templates/reports/extra-community/sql/entries.sql b/print/templates/reports/extra-community/sql/entries.sql index ad2529a1c..a90bf8b0b 100644 --- a/print/templates/reports/extra-community/sql/entries.sql +++ b/print/templates/reports/extra-community/sql/entries.sql @@ -1,17 +1,18 @@ SELECT - e.id, - e.travelFk, - e.ref, - s.name AS supplierName, - SUM(b.stickers) AS stickers, - CAST(SUM(i.density * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as loadedKg, - CAST(SUM(167.5 * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as volumeKg -FROM travel t - JOIN entry e ON e.travelFk = t.id - JOIN buy b ON b.entryFk = e.id - JOIN packaging pkg ON pkg.id = b.packageFk - JOIN item i ON i.id = b.itemFk - JOIN itemType it ON it.id = i.typeFk - JOIN supplier s ON s.id = e.supplierFk - WHERE t.id IN(?) -GROUP BY e.id \ No newline at end of file + e.id, + e.travelFk, + e.ref, + s.name AS supplierName, + SUM(b.stickers) AS stickers, + CAST(SUM(b.weight * b.stickers) as DECIMAL(10,0)) as loadedKg, + CAST(SUM(vc.aerealVolumetricDensity * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000) as DECIMAL(10,0)) as volumeKg + FROM travel t + JOIN entry e ON e.travelFk = t.id + JOIN buy b ON b.entryFk = e.id + JOIN packaging pkg ON pkg.id = b.packageFk + JOIN item i ON i.id = b.itemFk + JOIN itemType it ON it.id = i.typeFk + JOIN supplier s ON s.id = e.supplierFk + JOIN vn.volumeConfig vc + WHERE t.id IN(?) + GROUP BY e.id \ No newline at end of file diff --git a/print/templates/reports/extra-community/sql/travels.sql b/print/templates/reports/extra-community/sql/travels.sql index f8a4e0142..0f2f8d416 100644 --- a/print/templates/reports/extra-community/sql/travels.sql +++ b/print/templates/reports/extra-community/sql/travels.sql @@ -6,8 +6,8 @@ SELECT t.kg, am.id AS agencyModeFk, SUM(b.stickers) AS stickers, - CAST(SUM(i.density * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as loadedKg, - CAST(SUM(167.5 * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as volumeKg + CAST(SUM(b.weight * b.stickers) as DECIMAL(10,0)) as loadedKg, + CAST(SUM(vc.aerealVolumetricDensity * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000) as DECIMAL(10,0)) as volumeKg FROM travel t LEFT JOIN supplier s ON s.id = t.cargoSupplierFk LEFT JOIN entry e ON e.travelFk = t.id From 620162aec74d983e1136d1bebd49824d19188809 Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Fri, 23 Sep 2022 12:24:11 +0200 Subject: [PATCH 05/14] =?UTF-8?q?A=C3=B1adido=20el=20modelo=20de=20sector?= =?UTF-8?q?=20a=20shelving?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/shelving/back/models/sector.json | 72 ++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 modules/shelving/back/models/sector.json diff --git a/modules/shelving/back/models/sector.json b/modules/shelving/back/models/sector.json new file mode 100644 index 000000000..0dc502cd0 --- /dev/null +++ b/modules/shelving/back/models/sector.json @@ -0,0 +1,72 @@ +{ + "name": "Sector", + "base": "VnModel", + "options": { + "mysql": { + "table": "sector" + } + }, + "properties": { + "id": { + "type": "number", + "id": true, + "description": "Identifier" + }, + "description": { + "type": "string", + "required": true + }, + "warehouseFk": { + "type": "number", + "required": true + }, + "isPreviousPreparedByPacking": { + "type": "boolean", + "required": true + }, + "code": { + "type": "string", + "required": false + }, + "isPreviousPrepared": { + "type": "boolean", + "required": true + }, + "isPackagingArea": { + "type": "boolean", + "required": true + }, + "reportFk": { + "type": "number", + "required": false + }, + "sonFk": { + "type": "number", + "required": false + }, + "isMain": { + "type": "boolean", + "required": true + }, + "itemPackingTypeFk": { + "type": "string", + "required": false + }, + "workerFk": { + "type": "number", + "required": false + }, + "printerFk": { + "type": "number", + "required": false + }, + "isHideForPickers": { + "type": "boolean", + "required": true + }, + "isReserve": { + "type": "boolean", + "required": true + } + } +} \ No newline at end of file From 26a16bf846d3a7ed187fa2be772a6f3484c779e5 Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Fri, 23 Sep 2022 13:53:33 +0200 Subject: [PATCH 06/14] =?UTF-8?q?ACL=20para=20sector,a=C3=B1adido=20sector?= =?UTF-8?q?=20al=20model-config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/changes/10490-august/00-ACL.sql | 4 ++++ modules/shelving/back/model-config.json | 5 ++++- modules/worker/back/model-config.json | 3 --- modules/worker/back/models/sector.json | 20 -------------------- 4 files changed, 8 insertions(+), 24 deletions(-) create mode 100644 db/changes/10490-august/00-ACL.sql delete mode 100644 modules/worker/back/models/sector.json diff --git a/db/changes/10490-august/00-ACL.sql b/db/changes/10490-august/00-ACL.sql new file mode 100644 index 000000000..e07610c60 --- /dev/null +++ b/db/changes/10490-august/00-ACL.sql @@ -0,0 +1,4 @@ +INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId) + VALUES ('Sector','*','READ','ALLOW','ROLE','employee'); +INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId) + VALUES ('Sector','*','WRITE','ALLOW','ROLE','employee'); diff --git a/modules/shelving/back/model-config.json b/modules/shelving/back/model-config.json index b5619d8c5..c26c39d38 100644 --- a/modules/shelving/back/model-config.json +++ b/modules/shelving/back/model-config.json @@ -7,5 +7,8 @@ }, "ShelvingLog": { "dataSource": "vn" + }, + "Sector": { + "dataSource": "vn" } -} +} \ No newline at end of file diff --git a/modules/worker/back/model-config.json b/modules/worker/back/model-config.json index c6b984bd2..c155e331d 100644 --- a/modules/worker/back/model-config.json +++ b/modules/worker/back/model-config.json @@ -20,9 +20,6 @@ "EducationLevel": { "dataSource": "vn" }, - "Sector": { - "dataSource": "vn" - }, "WorkCenter": { "dataSource": "vn" }, diff --git a/modules/worker/back/models/sector.json b/modules/worker/back/models/sector.json deleted file mode 100644 index 8bd5e773f..000000000 --- a/modules/worker/back/models/sector.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "Sector", - "base": "VnModel", - "options": { - "mysql": { - "table": "sector" - } - }, - "properties": { - "id": { - "type": "number", - "id": true, - "description": "Identifier" - }, - "description": { - "type": "string", - "required": true - } - } -} \ No newline at end of file From 5e40bb07499f70ba73ca4b0403488c70f24b59a6 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 27 Sep 2022 09:37:09 +0200 Subject: [PATCH 07/14] fix(puppeteer): update version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d33b65f93..49496ec19 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "node-ssh": "^11.0.0", "object-diff": "0.0.4", "object.pick": "^1.3.0", - "puppeteer": "^7.1.0", + "puppeteer": "^18.0.5", "read-chunk": "^3.2.0", "require-yaml": "0.0.1", "sharp": "^0.27.1", From 426ff5f7537d233f1529bc9d166af17eeef79d3c Mon Sep 17 00:00:00 2001 From: jgallego Date: Tue, 27 Sep 2022 11:26:36 +0200 Subject: [PATCH 08/14] selector con weightByPieceCheckbox --- e2e/helpers/selectors.js | 2 +- e2e/paths/04-item/09_index.spec.js | 4 ++-- print/templates/reports/extra-community/sql/travels.sql | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 0ad9ad7f4..cf120043d 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -391,7 +391,7 @@ export default { intrastadCheckbox: '.vn-popover.shown vn-horizontal:nth-child(3) > vn-check[label="Intrastat"]', originCheckbox: '.vn-popover.shown vn-horizontal:nth-child(3) > vn-check[label="Origin"]', buyerCheckbox: '.vn-popover.shown vn-horizontal:nth-child(3) > vn-check[label="Buyer"]', - densityCheckbox: '.vn-popover.shown vn-horizontal:nth-child(3) > vn-check[label="Density"]', + weightByPieceCheckbox: '.vn-popover.shown vn-horizontal:nth-child(3) > vn-check[label="WeightByPiece"]', saveFieldsButton: '.vn-popover.shown vn-button[label="Save"] > button' }, itemFixedPrice: { diff --git a/e2e/paths/04-item/09_index.spec.js b/e2e/paths/04-item/09_index.spec.js index f9262863d..6e0a4bd5c 100644 --- a/e2e/paths/04-item/09_index.spec.js +++ b/e2e/paths/04-item/09_index.spec.js @@ -31,7 +31,7 @@ describe('Item index path', () => { await page.waitToClick(selectors.itemsIndex.intrastadCheckbox); await page.waitToClick(selectors.itemsIndex.originCheckbox); await page.waitToClick(selectors.itemsIndex.buyerCheckbox); - await page.waitToClick(selectors.itemsIndex.densityCheckbox); + await page.waitToClick(selectors.itemsIndex.weightByPieceCheckbox); await page.waitToClick(selectors.itemsIndex.saveFieldsButton); const message = await page.waitForSnackbar(); @@ -64,7 +64,7 @@ describe('Item index path', () => { await page.waitToClick(selectors.itemsIndex.intrastadCheckbox); await page.waitToClick(selectors.itemsIndex.originCheckbox); await page.waitToClick(selectors.itemsIndex.buyerCheckbox); - await page.waitToClick(selectors.itemsIndex.densityCheckbox); + await page.waitToClick(selectors.itemsIndex.weightByPieceCheckbox); await page.waitToClick(selectors.itemsIndex.saveFieldsButton); const message = await page.waitForSnackbar(); diff --git a/print/templates/reports/extra-community/sql/travels.sql b/print/templates/reports/extra-community/sql/travels.sql index 0f2f8d416..b0987c330 100644 --- a/print/templates/reports/extra-community/sql/travels.sql +++ b/print/templates/reports/extra-community/sql/travels.sql @@ -9,6 +9,7 @@ SELECT CAST(SUM(b.weight * b.stickers) as DECIMAL(10,0)) as loadedKg, CAST(SUM(vc.aerealVolumetricDensity * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000) as DECIMAL(10,0)) as volumeKg FROM travel t + JOIN volumeConfig vc LEFT JOIN supplier s ON s.id = t.cargoSupplierFk LEFT JOIN entry e ON e.travelFk = t.id LEFT JOIN buy b ON b.entryFk = e.id From 2dd6de1d47703a80097b62f729c33162853afbfc Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Tue, 27 Sep 2022 13:46:23 +0200 Subject: [PATCH 09/14] Modified Fixtures, clone.js and the item model --- db/dump/fixtures.sql | 36 ++++++++++++------------- modules/item/back/methods/item/clone.js | 1 - modules/item/back/models/item.json | 3 +++ 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index f7f241bc3..1f66a53cf 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -862,25 +862,25 @@ INSERT INTO `vn`.`itemFamily`(`code`, `description`) ('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`, `itemPackingTypeFk`, `hasMinPrice`, `packingShelve`) + `comment`, `relevancy`, `image`, `subName`, `minPrice`, `stars`, `family`, `isFloramondo`, `genericFk`, `itemPackingTypeFk`, `hasMinPrice`, `packingShelve`, `weightByPiece`) VALUES - (1, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '1', NULL, 0, 1, 'VT', 0, NULL, 'V', 0, 15), - (2, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '2', NULL, 0, 2, 'VT', 0, NULL, 'H', 0, 10), - (3, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '3', NULL, 0, 5, 'VT', 0, NULL, NULL, 0, 5), - (4, 1, 60, 'YEL', 1, 1, 'Increases block', 1, 05080000, 4751000000, NULL, 0, '4', NULL, 0, 3, 'VT', 0, NULL, NULL, 0, NULL), - (5, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '5', NULL, 0, 3, 'VT', 0, NULL, NULL, 0, NULL), - (6, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '6', NULL, 0, 4, 'VT', 0, NULL, NULL, 0, NULL), - (7, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '7', NULL, 0, 4, 'VT', 0, NULL, NULL, 0, NULL), - (8, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '8', NULL, 0, 5, 'VT', 0, NULL, NULL, 0, NULL), - (9, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '9', NULL, 0, 4, 'VT', 1, NULL, NULL, 0, NULL), - (10, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '10', NULL, 0, 4, 'VT', 0, NULL, NULL, 0, NULL), - (11, 1, 60, 'YEL', 1, 1, NULL, 1, 05080000, 4751000000, NULL, 0, '11', NULL, 0, 4, 'VT', 0, NULL, NULL, 0, NULL), - (12, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '12', NULL, 0, 3, 'VT', 0, NULL, NULL, 0, NULL), - (13, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '13', NULL, 1, 2, 'VT', 1, NULL, NULL, 1, NULL), - (14, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 4, 'VT', 1, NULL, NULL, 0, NULL), - (15, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0, NULL, NULL, 0, NULL), - (16, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0, NULL, NULL, 0, NULL), - (71, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'VT', 0, NULL, NULL, 0, NULL); + (1, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '1', NULL, 0, 1, 'VT', 0, NULL, 'V', 0, 15,3), + (2, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '2', NULL, 0, 2, 'VT', 0, NULL, 'H', 0, 10,2), + (3, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '3', NULL, 0, 5, 'VT', 0, NULL, NULL, 0, 5,5), + (4, 1, 60, 'YEL', 1, 1, 'Increases block', 1, 05080000, 4751000000, NULL, 0, '4', NULL, 0, 3, 'VT', 0, NULL, NULL, 0, NULL,NULL), + (5, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '5', NULL, 0, 3, 'VT', 0, NULL, NULL, 0, NULL,NULL), + (6, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '6', NULL, 0, 4, 'VT', 0, NULL, NULL, 0, NULL,NULL), + (7, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '7', NULL, 0, 4, 'VT', 0, NULL, NULL, 0, NULL,NULL), + (8, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '8', NULL, 0, 5, 'VT', 0, NULL, NULL, 0, NULL,NULL), + (9, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '9', NULL, 0, 4, 'VT', 1, NULL, NULL, 0, NULL,NULL), + (10, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '10', NULL, 0, 4, 'VT', 0, NULL, NULL, 0, NULL,NULL), + (11, 1, 60, 'YEL', 1, 1, NULL, 1, 05080000, 4751000000, NULL, 0, '11', NULL, 0, 4, 'VT', 0, NULL, NULL, 0, NULL,NULL), + (12, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '12', NULL, 0, 3, 'VT', 0, NULL, NULL, 0, NULL,NULL), + (13, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '13', NULL, 1, 2, 'VT', 1, NULL, NULL, 1, NULL,NULL), + (14, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 4, 'VT', 1, NULL, NULL, 0, NULL,NULL), + (15, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0, NULL, NULL, 0, NULL,NULL), + (16, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0, NULL, NULL, 0, NULL,NULL), + (71, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'VT', 0, NULL, NULL, 0, NULL,NULL); -- Update the taxClass after insert of the items UPDATE `vn`.`itemTaxCountry` SET `taxClassFk` = 2 diff --git a/modules/item/back/methods/item/clone.js b/modules/item/back/methods/item/clone.js index 3e6f3ab5a..6d07e83d3 100644 --- a/modules/item/back/methods/item/clone.js +++ b/modules/item/back/methods/item/clone.js @@ -42,7 +42,6 @@ module.exports = Self => { origin.itemTag = undefined; origin.description = undefined; - origin.image = undefined; origin.comment = undefined; origin.size = undefined; diff --git a/modules/item/back/models/item.json b/modules/item/back/models/item.json index 01b6ba093..a6328a456 100644 --- a/modules/item/back/models/item.json +++ b/modules/item/back/models/item.json @@ -143,6 +143,9 @@ }, "packingShelve": { "type": "number" + }, + "weightByPiece": { + "type": "number" } }, "relations": { From 901007d34b4b788d4ac017416b9b488b86e8cfc4 Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Tue, 27 Sep 2022 13:58:27 +0200 Subject: [PATCH 10/14] change test case to expect the image to be defined --- modules/item/back/methods/item/specs/clone.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/item/back/methods/item/specs/clone.spec.js b/modules/item/back/methods/item/specs/clone.spec.js index d376b9e5b..1f4a87ac1 100644 --- a/modules/item/back/methods/item/specs/clone.spec.js +++ b/modules/item/back/methods/item/specs/clone.spec.js @@ -21,7 +21,7 @@ describe('item clone()', () => { const result = await models.Item.clone(itemFk, options); expect(result.id).toEqual(nextItemId); - expect(result.image).toBeUndefined(); + expect(result.image).toBeDefined(); expect(result.itemTag).toBeUndefined(); expect(result.comment).toBeUndefined(); expect(result.description).toBeUndefined(); From 417222905189164ec5515eb56300d4a7a8e9248f Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 29 Sep 2022 09:35:57 +0200 Subject: [PATCH 11/14] Closure hotfix --- modules/monitor/front/index/tickets/index.html | 3 +++ print/methods/closure/closeAll.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/monitor/front/index/tickets/index.html b/modules/monitor/front/index/tickets/index.html index a504301a5..138788ed6 100644 --- a/modules/monitor/front/index/tickets/index.html +++ b/modules/monitor/front/index/tickets/index.html @@ -210,6 +210,9 @@ + + diff --git a/print/methods/closure/closeAll.js b/print/methods/closure/closeAll.js index dad8b4569..513574418 100644 --- a/print/methods/closure/closeAll.js +++ b/print/methods/closure/closeAll.js @@ -11,10 +11,10 @@ module.exports = async function(request, response, next) { if (reqArgs.to) toDate = reqArgs.to; const todayMinDate = new Date(); - minDate.setHours(0, 0, 0, 0); + todayMinDate.setHours(0, 0, 0, 0); const todayMaxDate = new Date(); - maxDate.setHours(23, 59, 59, 59); + todayMinDate.setHours(23, 59, 59, 59); // Prevent closure for current day if (toDate >= todayMinDate && toDate <= todayMaxDate) From d7b563c5ec4e6d6c115fff9cf5d8534eedf71fbd Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 29 Sep 2022 10:09:01 +0200 Subject: [PATCH 12/14] Debug logs --- print/methods/closure/closeAll.js | 2 ++ print/methods/closure/closure.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/print/methods/closure/closeAll.js b/print/methods/closure/closeAll.js index 513574418..36b853052 100644 --- a/print/methods/closure/closeAll.js +++ b/print/methods/closure/closeAll.js @@ -20,6 +20,8 @@ module.exports = async function(request, response, next) { if (toDate >= todayMinDate && toDate <= todayMaxDate) throw new Error('You cannot close tickets for today'); + console.log(`Making closure up to ${toDate}...`); + const tickets = await db.rawSql(` SELECT t.id, diff --git a/print/methods/closure/closure.js b/print/methods/closure/closure.js index 67a2538e8..fe5aba5e7 100644 --- a/print/methods/closure/closure.js +++ b/print/methods/closure/closure.js @@ -7,11 +7,13 @@ const storage = require('vn-print/core/storage'); module.exports = { async start(tickets, reqArgs) { + console.log(tickets); if (tickets.length == 0) return; const failedtickets = []; for (const ticket of tickets) { try { + console.log(`Closing ticket id ${ticket.id}...`); await db.rawSql(`CALL vn.ticket_closeByTicket(?)`, [ticket.id]); const invoiceOut = await db.findOne(` From 12f4ef0850e0c0f5c5771316e5ab1de649d3c726 Mon Sep 17 00:00:00 2001 From: joan Date: Fri, 30 Sep 2022 13:55:41 +0200 Subject: [PATCH 13/14] fix(print): log sent mails --- print/core/smtp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/print/core/smtp.js b/print/core/smtp.js index 50a413673..a55ba448d 100644 --- a/print/core/smtp.js +++ b/print/core/smtp.js @@ -29,7 +29,7 @@ module.exports = { for (let attachment of options.attachments) { const fileName = attachment.filename; const filePath = attachment.path; - if (fileName.includes('.png')) return; + if (fileName.includes('.png')) continue; if (fileName || filePath) attachments.push(filePath ? filePath : fileName); From eb48685484fbe64679372b9464c64b57b8bcac45 Mon Sep 17 00:00:00 2001 From: jgallego Date: Fri, 30 Sep 2022 14:55:31 +0200 Subject: [PATCH 14/14] selectores reparados --- e2e/helpers/selectors.js | 2 +- modules/entry/front/latest-buys/index.html | 2 +- modules/entry/front/latest-buys/index.js | 2 +- modules/item/front/basic-data/index.html | 2 +- modules/item/front/index/index.html | 2 +- modules/item/front/locale/es.yml | 2 +- modules/item/front/summary/index.html | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index cf120043d..237fdad0c 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -391,7 +391,7 @@ export default { intrastadCheckbox: '.vn-popover.shown vn-horizontal:nth-child(3) > vn-check[label="Intrastat"]', originCheckbox: '.vn-popover.shown vn-horizontal:nth-child(3) > vn-check[label="Origin"]', buyerCheckbox: '.vn-popover.shown vn-horizontal:nth-child(3) > vn-check[label="Buyer"]', - weightByPieceCheckbox: '.vn-popover.shown vn-horizontal:nth-child(3) > vn-check[label="WeightByPiece"]', + weightByPieceCheckbox: '.vn-popover.shown vn-horizontal:nth-child(3) > vn-check[label="Weight/Piece"]', saveFieldsButton: '.vn-popover.shown vn-button[label="Save"] > button' }, itemFixedPrice: { diff --git a/modules/entry/front/latest-buys/index.html b/modules/entry/front/latest-buys/index.html index c2ac9ee9b..fc44ddfc2 100644 --- a/modules/entry/front/latest-buys/index.html +++ b/modules/entry/front/latest-buys/index.html @@ -69,7 +69,7 @@ Origin - WeightByPiece + Weight/Piece Active diff --git a/modules/entry/front/latest-buys/index.js b/modules/entry/front/latest-buys/index.js index 16b2e22a7..d9065193e 100644 --- a/modules/entry/front/latest-buys/index.js +++ b/modules/entry/front/latest-buys/index.js @@ -80,7 +80,7 @@ export default class Controller extends Section { {field: 'weight', displayName: this.$t('Weight')}, {field: 'description', displayName: this.$t('Description')}, {field: 'size', displayName: this.$t('Size')}, - {field: 'weightByPiece', displayName: this.$t('weightByPiece')}, + {field: 'weightByPiece', displayName: this.$t('weight/Piece')}, {field: 'packingOut', displayName: this.$t('PackingOut')}, {field: 'landing', displayName: this.$t('Landing')} ]; diff --git a/modules/item/front/basic-data/index.html b/modules/item/front/basic-data/index.html index 2d608f505..8d1afe4e1 100644 --- a/modules/item/front/basic-data/index.html +++ b/modules/item/front/basic-data/index.html @@ -124,7 +124,7 @@ diff --git a/modules/item/front/index/index.html b/modules/item/front/index/index.html index 423d9c61a..6f5cce7c0 100644 --- a/modules/item/front/index/index.html +++ b/modules/item/front/index/index.html @@ -46,7 +46,7 @@ Buyer - WeightByPiece + Weight/Piece Multiplier diff --git a/modules/item/front/locale/es.yml b/modules/item/front/locale/es.yml index 76ed94d2f..1b75e3802 100644 --- a/modules/item/front/locale/es.yml +++ b/modules/item/front/locale/es.yml @@ -40,7 +40,7 @@ Create: Crear Client card: Ficha del cliente Shipped: F. envío stems: Tallos -WeightByPiece: Peso/tallo +Weight/Piece: Peso/tallo Search items by id, name or barcode: Buscar articulos por identificador, nombre o codigo de barras SalesPerson: Comercial Concept: Concepto diff --git a/modules/item/front/summary/index.html b/modules/item/front/summary/index.html index 3a651ec9e..a4d40c829 100644 --- a/modules/item/front/summary/index.html +++ b/modules/item/front/summary/index.html @@ -91,7 +91,7 @@ -