From 46abf2f57bafaca090d77e86ede873d40bc027c0 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 12 Aug 2024 10:27:26 +0200 Subject: [PATCH 1/8] fix(defaulter_filter): recovery subquery --- modules/client/back/methods/defaulter/filter.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/client/back/methods/defaulter/filter.js b/modules/client/back/methods/defaulter/filter.js index 40756b236..9f19dee0a 100644 --- a/modules/client/back/methods/defaulter/filter.js +++ b/modules/client/back/methods/defaulter/filter.js @@ -83,9 +83,14 @@ module.exports = Self => { LEFT JOIN account.user u ON u.id = c.salesPersonFk LEFT JOIN account.user uw ON uw.id = co.workerFk LEFT JOIN ( - SELECT MAX(started), clientFk, finished - FROM recovery - GROUP BY clientFk + SELECT r1.started, r1.clientFk, r1.finished + FROM recovery r1 + JOIN ( + SELECT MAX(started) AS maxStarted, clientFk + FROM recovery + GROUP BY clientFk + ) r2 ON r1.clientFk = r2.clientFk + AND r1.started = r2.maxStarted ) r ON r.clientFk = c.id LEFT JOIN workerDepartment wd ON wd.workerFk = u.id JOIN department dp ON dp.id = wd.departmentFk From 32d5ca0d5c3324d0e779239555ec5418f230962e Mon Sep 17 00:00:00 2001 From: sergiodt Date: Tue, 13 Aug 2024 11:37:08 +0200 Subject: [PATCH 2/8] fix: refs #6861 refs#6861 bySectorCollection --- .../vn/procedures/itemShelvingSale_addBySectorCollection.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/itemShelvingSale_addBySectorCollection.sql b/db/routines/vn/procedures/itemShelvingSale_addBySectorCollection.sql index c359c7c8d..26e661d9a 100644 --- a/db/routines/vn/procedures/itemShelvingSale_addBySectorCollection.sql +++ b/db/routines/vn/procedures/itemShelvingSale_addBySectorCollection.sql @@ -12,7 +12,7 @@ BEGIN DECLARE vSaleFk INT; DECLARE vSectorFk INT; DECLARE vSales CURSOR FOR - SELECT s.id + SELECT DISTINCT s.id FROM sectorCollectionSaleGroup sc JOIN saleGroupDetail sg ON sg.saleGroupFk = sc.saleGroupFk JOIN sale s ON sg.saleFk = s.id From a178c285c06f154ee3c0698f0a2e4d6db54eb09c Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 13 Aug 2024 10:44:54 +0000 Subject: [PATCH 3/8] fix(salix): #7867 avoid deactivate user when is supplier --- db/routines/vn/procedures/client_userDisable.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/db/routines/vn/procedures/client_userDisable.sql b/db/routines/vn/procedures/client_userDisable.sql index f2ba65c1c..da3c0efa1 100644 --- a/db/routines/vn/procedures/client_userDisable.sql +++ b/db/routines/vn/procedures/client_userDisable.sql @@ -21,6 +21,9 @@ BEGIN AND a.id IS NULL AND u.active AND c.created < util.VN_CURDATE() - INTERVAL vMonths MONTH + AND u.role NOT IN ( + SELECT id FROM `role` r WHERE r.name = 'supplier' + ) AND u.id NOT IN ( SELECT DISTINCT c.id FROM client c From dd5845abae6557774cc70a015e3e67ef23579006 Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 13 Aug 2024 12:49:56 +0200 Subject: [PATCH 4/8] fix: refs #7800 tpvMerchantEnable PRIMARY KEY --- db/versions/11190-blueLaurel/00-firstScript.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 db/versions/11190-blueLaurel/00-firstScript.sql diff --git a/db/versions/11190-blueLaurel/00-firstScript.sql b/db/versions/11190-blueLaurel/00-firstScript.sql new file mode 100644 index 000000000..484b77ad8 --- /dev/null +++ b/db/versions/11190-blueLaurel/00-firstScript.sql @@ -0,0 +1,6 @@ +ALTER TABLE hedera.tpvMerchantEnable DROP FOREIGN KEY tpvMerchantEnable_ibfk_1; +ALTER TABLE hedera.tpvMerchantEnable DROP PRIMARY KEY; +ALTER TABLE hedera.tpvMerchantEnable + ADD CONSTRAINT tpvMerchantEnable_pk PRIMARY KEY (merchantFk); +ALTER TABLE hedera.tpvMerchantEnable + ADD CONSTRAINT tpvMerchantEnable_tpvMerchant_FK FOREIGN KEY (merchantFk) REFERENCES hedera.tpvMerchant(id) ON DELETE RESTRICT ON UPDATE CASCADE; From 68ee5e3549a55b7ec8d48a859d9533ef3377631b Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 13 Aug 2024 12:52:39 +0200 Subject: [PATCH 5/8] fix: refs #7800 tpvMerchantEnable PRIMARY KEY --- db/versions/11190-blueLaurel/00-firstScript.sql | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/db/versions/11190-blueLaurel/00-firstScript.sql b/db/versions/11190-blueLaurel/00-firstScript.sql index 484b77ad8..75e3f8e59 100644 --- a/db/versions/11190-blueLaurel/00-firstScript.sql +++ b/db/versions/11190-blueLaurel/00-firstScript.sql @@ -1,6 +1,9 @@ -ALTER TABLE hedera.tpvMerchantEnable DROP FOREIGN KEY tpvMerchantEnable_ibfk_1; -ALTER TABLE hedera.tpvMerchantEnable DROP PRIMARY KEY; ALTER TABLE hedera.tpvMerchantEnable - ADD CONSTRAINT tpvMerchantEnable_pk PRIMARY KEY (merchantFk); -ALTER TABLE hedera.tpvMerchantEnable - ADD CONSTRAINT tpvMerchantEnable_tpvMerchant_FK FOREIGN KEY (merchantFk) REFERENCES hedera.tpvMerchant(id) ON DELETE RESTRICT ON UPDATE CASCADE; + DROP FOREIGN KEY tpvMerchantEnable_ibfk_1, + DROP PRIMARY KEY, + ADD CONSTRAINT tpvMerchantEnable_pk PRIMARY KEY (merchantFk), + ADD CONSTRAINT tpvMerchantEnable_tpvMerchant_FK + FOREIGN KEY (merchantFk) + REFERENCES hedera.tpvMerchant(id) + ON DELETE RESTRICT + ON UPDATE CASCADE; From befcf895342d6d8f57eb3bda53f0d2af9434e9ce Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 13 Aug 2024 11:18:23 +0000 Subject: [PATCH 6/8] fix(salix): #7867 apply SQL conventions --- db/routines/vn/procedures/client_userDisable.sql | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/db/routines/vn/procedures/client_userDisable.sql b/db/routines/vn/procedures/client_userDisable.sql index da3c0efa1..779ffd688 100644 --- a/db/routines/vn/procedures/client_userDisable.sql +++ b/db/routines/vn/procedures/client_userDisable.sql @@ -21,9 +21,7 @@ BEGIN AND a.id IS NULL AND u.active AND c.created < util.VN_CURDATE() - INTERVAL vMonths MONTH - AND u.role NOT IN ( - SELECT id FROM `role` r WHERE r.name = 'supplier' - ) + AND NOT u.role = (SELECT id FROM `role` WHERE name = 'supplier') AND u.id NOT IN ( SELECT DISTINCT c.id FROM client c From cf39e944f0802b3d5db5bc2e8ad8fad35b595a11 Mon Sep 17 00:00:00 2001 From: jorgep Date: Wed, 14 Aug 2024 11:00:17 +0200 Subject: [PATCH 7/8] feat: refs #7323 redirect to lilium --- front/salix/components/user-popover/index.html | 2 +- front/salix/components/user-popover/index.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/front/salix/components/user-popover/index.html b/front/salix/components/user-popover/index.html index 06a4af1e0..cedb3383b 100644 --- a/front/salix/components/user-popover/index.html +++ b/front/salix/components/user-popover/index.html @@ -38,7 +38,7 @@ My account diff --git a/front/salix/components/user-popover/index.js b/front/salix/components/user-popover/index.js index 1d88137ff..72cb734e9 100644 --- a/front/salix/components/user-popover/index.js +++ b/front/salix/components/user-popover/index.js @@ -82,6 +82,9 @@ class Controller { ? {id: $search} : {bank: {like: '%' + $search + '%'}}; } + async redirect(id) { + window.location.href = await this.vnConfig.vnApp.getUrl(`worker/${id}`); + } } Controller.$inject = ['$scope', '$translate', 'vnConfig', 'vnAuth', 'vnToken']; From b268bf5eb76ef9bd4681ca5a1985194aa4929d59 Mon Sep 17 00:00:00 2001 From: guillermo Date: Wed, 14 Aug 2024 12:47:44 +0200 Subject: [PATCH 8/8] feat: refs #7811 Added autorestart param pm2 --- back/process.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/back/process.yml b/back/process.yml index 08fee7a93..94072b57d 100644 --- a/back/process.yml +++ b/back/process.yml @@ -3,4 +3,5 @@ apps: name: salix-back instances: 1 max_restarts: 0 + autorestart: false node_args: --tls-min-v1.0 --openssl-legacy-provider