From 2064107897592413be6bdabc6e1479ab7dbdaf8f Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 4 Jul 2024 15:25:21 +0000 Subject: [PATCH 01/12] 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/12] 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/12] 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 dbd8f945552609cf8dde82a18af48aa1fe33b985 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Sun, 8 Sep 2024 12:49:55 +0200 Subject: [PATCH 04/12] 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 05/12] 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 06/12] 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 07/12] 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 08/12] 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 09/12] 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 10/12] 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 1c0e148233f066993713b92355fc4b00fc52c7f0 Mon Sep 17 00:00:00 2001 From: jgallego Date: Tue, 10 Sep 2024 09:08:43 +0200 Subject: [PATCH 11/12] 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 12/12] 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",