From 2064107897592413be6bdabc6e1479ab7dbdaf8f Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 4 Jul 2024 15:25:21 +0000 Subject: [PATCH 01/17] feat(salix): #7671 define isDestiny field in model --- back/models/warehouse.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/back/models/warehouse.json b/back/models/warehouse.json index 54006130b..9267900a5 100644 --- a/back/models/warehouse.json +++ b/back/models/warehouse.json @@ -25,6 +25,9 @@ "isManaged": { "type": "boolean" }, + "isDestiny": { + "type": "boolean" + }, "countryFk": { "type": "number" } From ea626821fc410e29ae5aac56ffb416c4613308e6 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 11 Jul 2024 06:17:19 +0200 Subject: [PATCH 02/17] feat(ssalix): refs #7671 #7671 checkDates --- modules/item/back/methods/fixed-price/filter.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/item/back/methods/fixed-price/filter.js b/modules/item/back/methods/fixed-price/filter.js index 9c91886c1..5580dfecf 100644 --- a/modules/item/back/methods/fixed-price/filter.js +++ b/modules/item/back/methods/fixed-price/filter.js @@ -137,6 +137,7 @@ module.exports = Self => { SELECT fp.id, fp.itemFk, fp.warehouseFk, + w.name as warehouseName, fp.rate2, fp.rate3, fp.started, @@ -160,6 +161,7 @@ module.exports = Self => { FROM priceFixed fp JOIN item i ON i.id = fp.itemFk JOIN itemType it ON it.id = i.typeFk + JOIN warehouse w ON fp.warehouseFk = w.id `); if (ctx.args.tags) { @@ -183,6 +185,11 @@ module.exports = Self => { } } } + if (ctx.req.query.showBadDates === 'true') { + stmt.merge({ + sql: `WHERE + fp.started< fp.ended `}); + } stmt.merge(conn.makeSuffix(filter)); From 9c5f38648ab84a1e6c5363d4ce8d1aa088124420 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 12 Jul 2024 00:24:26 +0200 Subject: [PATCH 03/17] feat(ssalix): refs #7671 #7671 checkDates to present --- modules/item/back/methods/fixed-price/filter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/item/back/methods/fixed-price/filter.js b/modules/item/back/methods/fixed-price/filter.js index 5580dfecf..0dde9da99 100644 --- a/modules/item/back/methods/fixed-price/filter.js +++ b/modules/item/back/methods/fixed-price/filter.js @@ -188,7 +188,7 @@ module.exports = Self => { if (ctx.req.query.showBadDates === 'true') { stmt.merge({ sql: `WHERE - fp.started< fp.ended `}); + fp.started> util.VN_CURDATE() `}); } stmt.merge(conn.makeSuffix(filter)); From 901cdc7117b1ac701447762c23f1a5846c93400d Mon Sep 17 00:00:00 2001 From: jorgep Date: Fri, 6 Sep 2024 14:18:15 +0200 Subject: [PATCH 04/17] feat: refs #4074 modify acls --- .../11216-salmonPaniculata/00-firstScript.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 db/versions/11216-salmonPaniculata/00-firstScript.sql diff --git a/db/versions/11216-salmonPaniculata/00-firstScript.sql b/db/versions/11216-salmonPaniculata/00-firstScript.sql new file mode 100644 index 000000000..956dcc25b --- /dev/null +++ b/db/versions/11216-salmonPaniculata/00-firstScript.sql @@ -0,0 +1,12 @@ +-- Place your SQL code here +DELETE FROM salix.ACL WHERE model = 'Province' LIMIT 1; +DELETE FROM salix.ACL WHERE model = 'Town' LIMIT 1; + +UPDATE salix.ACL SET accessType = 'READ' WHERE model = 'BankEntity'; +INSERT INTO salix.ACL + SET model = 'BankEntity', + property = '*', + accessType = 'WRITE', + permission = 'ALLOW', + principalType = 'ROLE', + principalId = 'financial'; From dbd8f945552609cf8dde82a18af48aa1fe33b985 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Sun, 8 Sep 2024 12:49:55 +0200 Subject: [PATCH 05/17] perf: refs #7671 improve showBadDates --- db/dump/dump.after.sql | 1 + modules/item/back/methods/fixed-price/filter.js | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/db/dump/dump.after.sql b/db/dump/dump.after.sql index 7508a36a7..a7de86efc 100644 --- a/db/dump/dump.after.sql +++ b/db/dump/dump.after.sql @@ -1,4 +1,5 @@ CREATE USER 'vn'@'localhost'; +INSERT INTO `ormConfig`(`id`,`selectLimit`) VALUES(1,1000); GRANT SELECT, INSERT, diff --git a/modules/item/back/methods/fixed-price/filter.js b/modules/item/back/methods/fixed-price/filter.js index 838e913bf..f8cbfb5eb 100644 --- a/modules/item/back/methods/fixed-price/filter.js +++ b/modules/item/back/methods/fixed-price/filter.js @@ -186,12 +186,12 @@ module.exports = Self => { } if (ctx.req.query.showBadDates === 'true') { stmt.merge({ - sql: `WHERE - fp.started> util.VN_CURDATE() `}); - } - - stmt.merge(conn.makeSuffix(filter)); - + sql: ` WHERE + fp.started> util.VN_CURDATE() `}); + } else + stmt.merge(conn.makeWhere(filter.where)); + stmt.merge(conn.makeOrderBy(filter.order)); + stmt.merge(conn.makeLimit(filter)); const fixedPriceIndex = stmts.push(stmt) - 1; const sql = ParameterizedSQL.join(stmts, ';'); const result = await conn.executeStmt(sql, myOptions); From 5c4a30f2f9873d7c38c780205e07545a750443fa Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Sun, 8 Sep 2024 12:50:32 +0200 Subject: [PATCH 06/17] perf: refs #7671 improve showBadDates --- db/dump/dump.after.sql | 1 - modules/item/back/methods/fixed-price/filter.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/db/dump/dump.after.sql b/db/dump/dump.after.sql index a7de86efc..7508a36a7 100644 --- a/db/dump/dump.after.sql +++ b/db/dump/dump.after.sql @@ -1,5 +1,4 @@ CREATE USER 'vn'@'localhost'; -INSERT INTO `ormConfig`(`id`,`selectLimit`) VALUES(1,1000); GRANT SELECT, INSERT, diff --git a/modules/item/back/methods/fixed-price/filter.js b/modules/item/back/methods/fixed-price/filter.js index f8cbfb5eb..addc7027d 100644 --- a/modules/item/back/methods/fixed-price/filter.js +++ b/modules/item/back/methods/fixed-price/filter.js @@ -136,7 +136,7 @@ module.exports = Self => { SELECT DISTINCT fp.id, fp.itemFk, fp.warehouseFk, - w.name as warehouseName, + w.name warehouseName, fp.rate2, fp.rate3, fp.started, From 601260494694578df7e0c06e450eb4ef39e08544 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 9 Sep 2024 09:57:38 +0200 Subject: [PATCH 07/17] perf(salix): refs #7671 #7671 imrpove and revert where changes --- modules/item/back/methods/fixed-price/filter.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/modules/item/back/methods/fixed-price/filter.js b/modules/item/back/methods/fixed-price/filter.js index addc7027d..3bc8ed6b0 100644 --- a/modules/item/back/methods/fixed-price/filter.js +++ b/modules/item/back/methods/fixed-price/filter.js @@ -128,6 +128,9 @@ module.exports = Self => { return {[param]: value}; } }); + if (ctx.req.query.showBadDates === 'true') + where['fp.started'] = {gte: Date.vnNew()}; + filter = mergeFilters(filter, {where}); const stmts = []; @@ -184,14 +187,8 @@ module.exports = Self => { } } } - if (ctx.req.query.showBadDates === 'true') { - stmt.merge({ - sql: ` WHERE - fp.started> util.VN_CURDATE() `}); - } else - stmt.merge(conn.makeWhere(filter.where)); - stmt.merge(conn.makeOrderBy(filter.order)); - stmt.merge(conn.makeLimit(filter)); + + stmt.merge(conn.makeSuffix(filter)); const fixedPriceIndex = stmts.push(stmt) - 1; const sql = ParameterizedSQL.join(stmts, ';'); const result = await conn.executeStmt(sql, myOptions); From 7710b87f4a84cc5a057d90b2d1b378c74a3b7237 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 9 Sep 2024 10:07:05 +0200 Subject: [PATCH 08/17] test(salix): refs #7671 #7671 improve and revert where changes --- modules/item/back/methods/fixed-price/filter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/item/back/methods/fixed-price/filter.js b/modules/item/back/methods/fixed-price/filter.js index 3bc8ed6b0..488c2441d 100644 --- a/modules/item/back/methods/fixed-price/filter.js +++ b/modules/item/back/methods/fixed-price/filter.js @@ -128,7 +128,7 @@ module.exports = Self => { return {[param]: value}; } }); - if (ctx.req.query.showBadDates === 'true') + if (ctx.req.query?.showBadDates === 'true') where['fp.started'] = {gte: Date.vnNew()}; filter = mergeFilters(filter, {where}); From 88a8b4975bd9118f1c7a306b964a69f7c731ef5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Mon, 9 Sep 2024 12:37:49 +0200 Subject: [PATCH 09/17] fix: ticket 218504 ticket_close --- db/routines/vn/procedures/ticket_close.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/ticket_close.sql b/db/routines/vn/procedures/ticket_close.sql index f8bbe239b..639b6b505 100644 --- a/db/routines/vn/procedures/ticket_close.sql +++ b/db/routines/vn/procedures/ticket_close.sql @@ -85,7 +85,7 @@ BEGIN IF(vHasDailyInvoice) AND vHasToInvoice THEN SELECT invoiceSerial(vClientFk, vCompanyFk, 'quick') INTO vSerial; - IF NOT vSerial THEN + IF vSerial IS NULL THEN CALL util.throw('Cannot booking without a serial'); END IF; From d9a4b3e6fb7b689a644499ca205b3e3c54c57226 Mon Sep 17 00:00:00 2001 From: guillermo Date: Mon, 9 Sep 2024 12:42:19 +0200 Subject: [PATCH 10/17] fix: refs #7346 Global invoice --- modules/invoiceOut/front/global-invoicing/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/invoiceOut/front/global-invoicing/index.js b/modules/invoiceOut/front/global-invoicing/index.js index 9a936611a..b9a5ffe91 100644 --- a/modules/invoiceOut/front/global-invoicing/index.js +++ b/modules/invoiceOut/front/global-invoicing/index.js @@ -105,7 +105,8 @@ class Controller extends Section { addressId: address.id, invoiceDate: this.invoiceDate, maxShipped: this.maxShipped, - companyFk: this.companyFk + companyFk: this.companyFk, + serialType: 'quick' }; this.$http.post(`InvoiceOuts/invoiceClient`, params) From 52f368e4f7d96d91598ec0917f796915d86336c7 Mon Sep 17 00:00:00 2001 From: guillermo Date: Mon, 9 Sep 2024 14:25:13 +0200 Subject: [PATCH 11/17] fix: refs #7346 Global invoice --- modules/invoiceOut/front/global-invoicing/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/invoiceOut/front/global-invoicing/index.js b/modules/invoiceOut/front/global-invoicing/index.js index b9a5ffe91..5ea8c2c28 100644 --- a/modules/invoiceOut/front/global-invoicing/index.js +++ b/modules/invoiceOut/front/global-invoicing/index.js @@ -106,7 +106,7 @@ class Controller extends Section { invoiceDate: this.invoiceDate, maxShipped: this.maxShipped, companyFk: this.companyFk, - serialType: 'quick' + serialType: 'global' }; this.$http.post(`InvoiceOuts/invoiceClient`, params) From 45649359be0b2c788d93f1847a9c9b18159cad1d Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 9 Sep 2024 15:59:17 +0200 Subject: [PATCH 12/17] chore: refs #4074 fix test --- .../02-client/04_edit_billing_data.spec.js | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/e2e/paths/02-client/04_edit_billing_data.spec.js b/e2e/paths/02-client/04_edit_billing_data.spec.js index 10eb85406..12a2e7b74 100644 --- a/e2e/paths/02-client/04_edit_billing_data.spec.js +++ b/e2e/paths/02-client/04_edit_billing_data.spec.js @@ -18,7 +18,7 @@ const $ = { watcher: 'vn-client-billing-data vn-watcher' }; -describe('Client Edit billing data path', () => { +fdescribe('Client Edit billing data path', () => { let browser; let page; beforeAll(async() => { @@ -35,6 +35,14 @@ describe('Client Edit billing data path', () => { it(`should attempt to edit the billing data without an IBAN but fail`, async() => { await page.autocompleteSearch($.payMethod, 'PayMethod with IBAN'); + await page.waitToClick($.saveButton); + const message = await page.waitForSnackbar(); + + expect(message.text).toContain('That payment method requires an IBAN'); + }); + + it(`should edit the billing data and save the form`, async() => { + await page.autocompleteSearch($.payMethod, 'PayMethod five'); await page.autocompleteSearch($.swiftBic, 'BBKKESMMMMM'); await page.clearInput($.dueDay); await page.write($.dueDay, '60'); @@ -45,10 +53,13 @@ describe('Client Edit billing data path', () => { await page.waitToClick($.saveButton); const message = await page.waitForSnackbar(); - expect(message.text).toContain('That payment method requires an IBAN'); + expect(message.text).toContain('Notification sent!'); }); it(`should create a new BIC code`, async() => { + await page.loginAndModule('financial', 'client'); + await page.accessToSearchResult('Bruce Banner'); + await page.accessToSection('client.card.billingData'); await page.waitToClick($.newBankEntityButton); await page.write($.newBankEntityName, 'Gotham City Bank'); await page.write($.newBankEntityBIC, 'GTHMCT'); @@ -66,7 +77,7 @@ describe('Client Edit billing data path', () => { it(`should confirm the IBAN pay method was sucessfully saved`, async() => { const payMethod = await page.waitToGetProperty($.payMethod, 'value'); - expect(payMethod).toEqual('PayMethod with IBAN'); + expect(payMethod).toEqual('PayMethod five'); }); it(`should clear the BIC code field, update the IBAN to see how he BIC code autocompletes`, async() => { @@ -79,14 +90,6 @@ describe('Client Edit billing data path', () => { expect(automaticCode).toEqual('CAIXESBB'); }); - it(`should save the form with all its new data`, async() => { - await page.waitForWatcherData($.watcher); - await page.waitToClick($.saveButton); - const message = await page.waitForSnackbar(); - - expect(message.text).toContain('Notification sent!'); - }); - it('should confirm the billing data have been edited', async() => { const dueDate = await page.waitToGetProperty($.dueDay, 'value'); const IBAN = await page.waitToGetProperty($.IBAN, 'value'); @@ -94,7 +97,9 @@ describe('Client Edit billing data path', () => { const receivedCoreLCR = await page.checkboxState($.receivedCoreLCRCheckbox); const receivedCoreVNL = await page.checkboxState($.receivedCoreVNLCheckbox); const receivedB2BVNL = await page.checkboxState($.receivedB2BVNLCheckbox); + const payMethod = await page.waitToGetProperty($.payMethod, 'value'); + expect(payMethod).toEqual('PayMethod five'); expect(dueDate).toEqual('60'); expect(IBAN).toEqual('ES9121000418450200051332'); expect(swiftBic).toEqual('CAIXESBB'); From eadff638f90d9472f96c4a0dc061457b85cb6e86 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 9 Sep 2024 15:59:40 +0200 Subject: [PATCH 13/17] chore: refs #4074 drop focus --- e2e/paths/02-client/04_edit_billing_data.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/paths/02-client/04_edit_billing_data.spec.js b/e2e/paths/02-client/04_edit_billing_data.spec.js index 12a2e7b74..ca2c3b953 100644 --- a/e2e/paths/02-client/04_edit_billing_data.spec.js +++ b/e2e/paths/02-client/04_edit_billing_data.spec.js @@ -18,7 +18,7 @@ const $ = { watcher: 'vn-client-billing-data vn-watcher' }; -fdescribe('Client Edit billing data path', () => { +describe('Client Edit billing data path', () => { let browser; let page; beforeAll(async() => { From e74da7cbaba7cf08c025fe08b4cc79f2c236a9b4 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 10 Sep 2024 08:17:47 +0200 Subject: [PATCH 14/17] feat: refs #7953 pullinfo --- db/.pullinfo.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/.pullinfo.json b/db/.pullinfo.json index 27d2c7535..5b75584d1 100644 --- a/db/.pullinfo.json +++ b/db/.pullinfo.json @@ -9,7 +9,7 @@ }, "vn": { "view": { - "expeditionPallet_Print": "ced2b84a114fcb99fce05f0c34f4fc03f3fa387bef92621be1bc306608a84345" + "expeditionPallet_Print": "99f75145ac2e7b612a6d71e74b6e55f194a465780fd9875a15eb01e6596b447e" } } } From 1c0e148233f066993713b92355fc4b00fc52c7f0 Mon Sep 17 00:00:00 2001 From: jgallego Date: Tue, 10 Sep 2024 09:08:43 +0200 Subject: [PATCH 15/17] fix: cau #217599 --- modules/client/back/models/client.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/client/back/models/client.js b/modules/client/back/models/client.js index 0a8ebcae5..dc19c5d81 100644 --- a/modules/client/back/models/client.js +++ b/modules/client/back/models/client.js @@ -320,7 +320,8 @@ module.exports = Self => { // Credit management changes - if (changes?.rating >= 0 || changes?.recommendedCredit >= 0) + if ((changes?.rating != null && changes.rating >= 0) + || (changes?.recommendedCredit != null && changes.recommendedCredit >= 0)) await Self.changeCreditManagement(ctx, finalState, changes); const oldInstance = {}; From bb27f0f1f531b958f49910b83a3559d60022c82b Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 10 Sep 2024 10:34:28 +0200 Subject: [PATCH 16/17] build: init version 2440 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bbb83c4b0..1d3b9d253 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-back", - "version": "24.36.0", + "version": "24.40.0", "author": "Verdnatura Levante SL", "description": "Salix backend", "license": "GPL-3.0", From 01d591af53d5b00eed6e35f3537f9eb423df318f Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 10 Sep 2024 12:58:16 +0200 Subject: [PATCH 17/17] fix: refs #7564 Deleted query --- db/versions/11124-greenBamboo/01-firstScript.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db/versions/11124-greenBamboo/01-firstScript.sql b/db/versions/11124-greenBamboo/01-firstScript.sql index 9cacbd5ff..af3a40f14 100644 --- a/db/versions/11124-greenBamboo/01-firstScript.sql +++ b/db/versions/11124-greenBamboo/01-firstScript.sql @@ -1,4 +1,5 @@ -- Calculamos todos los volumenes de todos los tickets una sola vez +/* Se ejecutará el dia de test - master manualmente para no hacer lenta la subida CREATE OR REPLACE TEMPORARY TABLE tmp.tTicketVolume (PRIMARY KEY (id)) ENGINE = MEMORY @@ -14,3 +15,4 @@ UPDATE vn.ticket t SET t.volume = tv.volume; DROP TEMPORARY TABLE tmp.tTicketVolume; +*/