From 952f8f3dfcb6976b98d33ba3ab5da5286f8de632 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 7 Oct 2024 15:14:03 +0200 Subject: [PATCH 01/21] feat(Docuware): refs #8066 use oath --- back/methods/docuware/core.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/back/methods/docuware/core.js b/back/methods/docuware/core.js index 74d922236..760909aa3 100644 --- a/back/methods/docuware/core.js +++ b/back/methods/docuware/core.js @@ -8,12 +8,22 @@ module.exports = Self => { * @return {object} - The headers */ Self.getOptions = async() => { - const docuwareConfig = await Self.app.models.DocuwareConfig.findOne(); + const {url, username, password} = await Self.app.models.DocuwareConfig.findOne(); + const {IdentityServiceUrl} = await axios.get(`${url}/Home/IdentityServiceInfo`); + const {token_endpoint} = await axios.get(`${IdentityServiceUrl}/.well-known/openid-configuration`); + const {access_token} = await axios.post(token_endpoint, { + grant_type: 'password', + scope: 'docuware.platform', + client_id: 'docuware.platform.net.client', + username, // falta añadirlos + password // falta añadirlos + }); + const headers = { headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', - 'Cookie': docuwareConfig.cookie + 'access_token': access_token } }; From b4dc5276ddf9f16678cbdc4664b890d563d6e263 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 8 Oct 2024 08:36:17 +0200 Subject: [PATCH 02/21] fix: refs #7986 create fk --- db/versions/11290-blackOrchid/00-firstScript.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 db/versions/11290-blackOrchid/00-firstScript.sql diff --git a/db/versions/11290-blackOrchid/00-firstScript.sql b/db/versions/11290-blackOrchid/00-firstScript.sql new file mode 100644 index 000000000..e573e9e32 --- /dev/null +++ b/db/versions/11290-blackOrchid/00-firstScript.sql @@ -0,0 +1,6 @@ + +ALTER TABLE `vn`.`worker` +ADD COLUMN `motoFk` INT(11) UNSIGNED DEFAULT NULL; + +ALTER TABLE `vn`.`worker` +ADD CONSTRAINT `worker_machineFk` FOREIGN KEY (`motoFk`) REFERENCES `machine` (`id`) ON UPDATE CASCADE ON DELETE SET NULL; From 9695fea48f30207dffe9897993af2446acb23b9a Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 8 Oct 2024 12:05:19 +0200 Subject: [PATCH 03/21] feat(Docuware): refs #8066 add username and password --- back/methods/docuware/core.js | 25 ++++++++++--------- back/models/docuware-config.json | 17 ++++++------- .../11291-purpleChico/00-firstScript.sql | 2 ++ 3 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 db/versions/11291-purpleChico/00-firstScript.sql diff --git a/back/methods/docuware/core.js b/back/methods/docuware/core.js index 760909aa3..9545cd878 100644 --- a/back/methods/docuware/core.js +++ b/back/methods/docuware/core.js @@ -9,15 +9,16 @@ module.exports = Self => { */ Self.getOptions = async() => { const {url, username, password} = await Self.app.models.DocuwareConfig.findOne(); - const {IdentityServiceUrl} = await axios.get(`${url}/Home/IdentityServiceInfo`); - const {token_endpoint} = await axios.get(`${IdentityServiceUrl}/.well-known/openid-configuration`); - const {access_token} = await axios.post(token_endpoint, { + const {data: {IdentityServiceUrl}} = await axios.get(`${url}/Home/IdentityServiceInfo`); + const {data: {token_endpoint}} = await axios.get(`${IdentityServiceUrl}/.well-known/openid-configuration`); + const data = await axios.post(token_endpoint, JSON.stringify({ grant_type: 'password', scope: 'docuware.platform', client_id: 'docuware.platform.net.client', - username, // falta añadirlos - password // falta añadirlos - }); + username, + password + })); + console.log('data: ', data); const headers = { headers: { @@ -42,8 +43,8 @@ module.exports = Self => { * @return {number} - The fileCabinet id */ Self.getDialog = async(code, action, fileCabinetId) => { - if (!process.env.NODE_ENV) - return Math.floor(Math.random() + 100); + // if (!process.env.NODE_ENV) + // return Math.floor(Math.random() + 100); const docuwareInfo = await Self.app.models.Docuware.findOne({ where: { @@ -69,8 +70,8 @@ module.exports = Self => { * @return {number} - The fileCabinet id */ Self.getFileCabinet = async code => { - if (!process.env.NODE_ENV) - return Math.floor(Math.random() + 100); + // if (!process.env.NODE_ENV) + // return Math.floor(Math.random() + 100); const options = await Self.getOptions(); const docuwareInfo = await Self.app.models.Docuware.findOne({ @@ -95,7 +96,7 @@ module.exports = Self => { * @return {object} - The data */ Self.get = async(code, filter, parse) => { - if (!process.env.NODE_ENV) return; + // if (!process.env.NODE_ENV) return; const options = await Self.getOptions(); const fileCabinetId = await Self.getFileCabinet(code); @@ -118,7 +119,7 @@ module.exports = Self => { * @return {object} - The data */ Self.getById = async(code, id, parse) => { - if (!process.env.NODE_ENV) return; + // if (!process.env.NODE_ENV) return; const docuwareInfo = await Self.app.models.Docuware.findOne({ fields: ['findById'], diff --git a/back/models/docuware-config.json b/back/models/docuware-config.json index 9d06c4874..244ae2790 100644 --- a/back/models/docuware-config.json +++ b/back/models/docuware-config.json @@ -18,15 +18,12 @@ }, "cookie": { "type": "string" + }, + "username": { + "type": "string" + }, + "password": { + "type": "string" } - }, - "acls": [ - { - "property": "*", - "accessType": "*", - "principalType": "ROLE", - "principalId": "$everyone", - "permission": "ALLOW" - } - ] + } } diff --git a/db/versions/11291-purpleChico/00-firstScript.sql b/db/versions/11291-purpleChico/00-firstScript.sql new file mode 100644 index 000000000..db66c4c98 --- /dev/null +++ b/db/versions/11291-purpleChico/00-firstScript.sql @@ -0,0 +1,2 @@ +ALTER TABLE vn.docuwareConfig ADD IF NOT EXISTS username varchar(100) NULL; +ALTER TABLE vn.docuwareConfig ADD IF NOT EXISTS password varchar(100) NULL; From 39e808bca764d2283994b18758413a6882e44283 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 8 Oct 2024 16:06:38 +0200 Subject: [PATCH 04/21] fix: refs #7986 fix model --- db/versions/11290-blackOrchid/00-firstScript.sql | 9 +++------ modules/worker/back/models/operator.json | 14 +++++++++++--- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/db/versions/11290-blackOrchid/00-firstScript.sql b/db/versions/11290-blackOrchid/00-firstScript.sql index e573e9e32..e0c0e391c 100644 --- a/db/versions/11290-blackOrchid/00-firstScript.sql +++ b/db/versions/11290-blackOrchid/00-firstScript.sql @@ -1,6 +1,3 @@ - -ALTER TABLE `vn`.`worker` -ADD COLUMN `motoFk` INT(11) UNSIGNED DEFAULT NULL; - -ALTER TABLE `vn`.`worker` -ADD CONSTRAINT `worker_machineFk` FOREIGN KEY (`motoFk`) REFERENCES `machine` (`id`) ON UPDATE CASCADE ON DELETE SET NULL; +ALTER TABLE `vn`.`operator` +ADD COLUMN `machineFk` int(11) DEFAULT NULL, +ADD CONSTRAINT `operator_machine_FK` FOREIGN KEY (`machineFk`) REFERENCES `vn`.`machine` (`id`) ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/modules/worker/back/models/operator.json b/modules/worker/back/models/operator.json index d4832bccf..9933babc6 100644 --- a/modules/worker/back/models/operator.json +++ b/modules/worker/back/models/operator.json @@ -30,7 +30,10 @@ "isOnReservationMode": { "type": "boolean", "required": true - } + }, + "machineFk": { + "type": "number" + } }, "relations": { "sector": { @@ -53,6 +56,11 @@ "model": "ItemPackingType", "foreignKey": "itemPackingTypeFk", "primaryKey": "code" - } + }, + "machine": { + "type": "belongsTo", + "model": "Machine", + "foreignKey": "machineFk" + } } -} \ No newline at end of file +} From 3c881d5e483b904dfcb0be489e313345099c755a Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 15 Oct 2024 08:00:19 +0200 Subject: [PATCH 05/21] refactor(docuware): refs #8066 use Authorization --- back/methods/docuware/core.js | 42 ++++++++++++------- back/methods/docuware/upload.js | 2 +- back/models/docuware-config.json | 5 ++- .../11291-purpleChico/00-firstScript.sql | 2 + 4 files changed, 35 insertions(+), 16 deletions(-) diff --git a/back/methods/docuware/core.js b/back/methods/docuware/core.js index 9545cd878..6d3bb58ed 100644 --- a/back/methods/docuware/core.js +++ b/back/methods/docuware/core.js @@ -4,32 +4,45 @@ module.exports = Self => { /** * Returns basic headers * - * @param {string} cookie - The docuware cookie * @return {object} - The headers */ Self.getOptions = async() => { - const {url, username, password} = await Self.app.models.DocuwareConfig.findOne(); - const {data: {IdentityServiceUrl}} = await axios.get(`${url}/Home/IdentityServiceInfo`); - const {data: {token_endpoint}} = await axios.get(`${IdentityServiceUrl}/.well-known/openid-configuration`); - const data = await axios.post(token_endpoint, JSON.stringify({ - grant_type: 'password', - scope: 'docuware.platform', - client_id: 'docuware.platform.net.client', - username, - password - })); - console.log('data: ', data); + const docuwareConfig = await Self.app.models.DocuwareConfig.findOne(); + const now = new Date().getTime(); + let {url, username, password, token, expired} = docuwareConfig; + + if (!expired || expired < now + 60) { + const {data: {IdentityServiceUrl}} = await axios.get(`${url}/Home/IdentityServiceInfo`); + const {data: {token_endpoint}} = await axios.get(`${IdentityServiceUrl}/.well-known/openid-configuration`); + const {data} = await axios.post(token_endpoint, { + grant_type: 'password', + scope: 'docuware.platform', + client_id: 'docuware.platform.net.client', + username, + password + }, {headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/x-www-form-urlencoded' + }}); + + const newToken = data.access_token; + token = data.token_type + ' ' + newToken; + await docuwareConfig.updateAttributes({ + token, + expired: now + data.expires_in + }); + } const headers = { headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', - 'access_token': access_token + 'Authorization': token } }; return { - url: docuwareConfig.url, + url, headers }; }; @@ -80,6 +93,7 @@ module.exports = Self => { } }); + console.log('options.headers: ', options.headers); const fileCabinetResponse = await axios.get(`${options.url}/FileCabinets`, options.headers); const fileCabinets = fileCabinetResponse.data.FileCabinet; const fileCabinetId = fileCabinets.find(fileCabinet => fileCabinet.Name === docuwareInfo.fileCabinetName).Id; diff --git a/back/methods/docuware/upload.js b/back/methods/docuware/upload.js index 0102911e0..5b35b7598 100644 --- a/back/methods/docuware/upload.js +++ b/back/methods/docuware/upload.js @@ -143,7 +143,7 @@ module.exports = Self => { headers: { 'Content-Type': 'multipart/form-data', 'X-File-ModifiedDate': Date.vnNew(), - 'Cookie': docuwareOptions.headers.headers.Cookie, + 'Authorization': docuwareOptions.headers.headers.Authorization, ...data.getHeaders() }, }; diff --git a/back/models/docuware-config.json b/back/models/docuware-config.json index 244ae2790..b15cb4c03 100644 --- a/back/models/docuware-config.json +++ b/back/models/docuware-config.json @@ -16,7 +16,7 @@ "url": { "type": "string" }, - "cookie": { + "token": { "type": "string" }, "username": { @@ -24,6 +24,9 @@ }, "password": { "type": "string" + }, + "expired":{ + "type": "number" } } } diff --git a/db/versions/11291-purpleChico/00-firstScript.sql b/db/versions/11291-purpleChico/00-firstScript.sql index db66c4c98..e60b90376 100644 --- a/db/versions/11291-purpleChico/00-firstScript.sql +++ b/db/versions/11291-purpleChico/00-firstScript.sql @@ -1,2 +1,4 @@ ALTER TABLE vn.docuwareConfig ADD IF NOT EXISTS username varchar(100) NULL; ALTER TABLE vn.docuwareConfig ADD IF NOT EXISTS password varchar(100) NULL; +ALTER TABLE vn.docuwareConfig ADD IF NOT EXISTS token text NULL; +ALTER TABLE vn.docuwareConfig ADD IF NOT EXISTS expired int(11) NULL; From c73fd51a9ca6ff5a5cf1d7490a2ba83b1f566d85 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 15 Oct 2024 09:45:14 +0200 Subject: [PATCH 06/21] fix: refs #7986 add acl --- db/versions/11290-blackOrchid/00-firstScript.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/db/versions/11290-blackOrchid/00-firstScript.sql b/db/versions/11290-blackOrchid/00-firstScript.sql index e0c0e391c..fe568ed6e 100644 --- a/db/versions/11290-blackOrchid/00-firstScript.sql +++ b/db/versions/11290-blackOrchid/00-firstScript.sql @@ -1,3 +1,6 @@ ALTER TABLE `vn`.`operator` ADD COLUMN `machineFk` int(11) DEFAULT NULL, ADD CONSTRAINT `operator_machine_FK` FOREIGN KEY (`machineFk`) REFERENCES `vn`.`machine` (`id`) ON DELETE SET NULL ON UPDATE CASCADE; + +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES ('Machine','*','*','ALLOW','ROLE','productionBoss'); From b1b36a33a0eb7fb2215305ef56bb3e12c650ca8b Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 15 Oct 2024 09:47:39 +0200 Subject: [PATCH 07/21] chore(docuware_core): refs #8066 add returns --- back/methods/docuware/core.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/back/methods/docuware/core.js b/back/methods/docuware/core.js index 6d3bb58ed..391a8b4ab 100644 --- a/back/methods/docuware/core.js +++ b/back/methods/docuware/core.js @@ -56,8 +56,8 @@ module.exports = Self => { * @return {number} - The fileCabinet id */ Self.getDialog = async(code, action, fileCabinetId) => { - // if (!process.env.NODE_ENV) - // return Math.floor(Math.random() + 100); + if (!process.env.NODE_ENV) + return Math.floor(Math.random() + 100); const docuwareInfo = await Self.app.models.Docuware.findOne({ where: { @@ -83,8 +83,8 @@ module.exports = Self => { * @return {number} - The fileCabinet id */ Self.getFileCabinet = async code => { - // if (!process.env.NODE_ENV) - // return Math.floor(Math.random() + 100); + if (!process.env.NODE_ENV) + return Math.floor(Math.random() + 100); const options = await Self.getOptions(); const docuwareInfo = await Self.app.models.Docuware.findOne({ @@ -93,7 +93,6 @@ module.exports = Self => { } }); - console.log('options.headers: ', options.headers); const fileCabinetResponse = await axios.get(`${options.url}/FileCabinets`, options.headers); const fileCabinets = fileCabinetResponse.data.FileCabinet; const fileCabinetId = fileCabinets.find(fileCabinet => fileCabinet.Name === docuwareInfo.fileCabinetName).Id; @@ -110,7 +109,7 @@ module.exports = Self => { * @return {object} - The data */ Self.get = async(code, filter, parse) => { - // if (!process.env.NODE_ENV) return; + if (!process.env.NODE_ENV) return; const options = await Self.getOptions(); const fileCabinetId = await Self.getFileCabinet(code); @@ -133,7 +132,7 @@ module.exports = Self => { * @return {object} - The data */ Self.getById = async(code, id, parse) => { - // if (!process.env.NODE_ENV) return; + if (!process.env.NODE_ENV) return; const docuwareInfo = await Self.app.models.Docuware.findOne({ fields: ['findById'], From 099fe8f9502164570079c8a718249b03b9761a95 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 15 Oct 2024 14:42:35 +0200 Subject: [PATCH 08/21] fix: refs #7986 fix model --- modules/worker/back/models/operator.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/worker/back/models/operator.json b/modules/worker/back/models/operator.json index 9933babc6..b75bf6732 100644 --- a/modules/worker/back/models/operator.json +++ b/modules/worker/back/models/operator.json @@ -24,6 +24,9 @@ "warehouseFk": { "type": "number" }, + "sectorFk": { + "type": "number" + }, "labelerFk": { "type": "number" }, @@ -33,6 +36,15 @@ }, "machineFk": { "type": "number" + }, + "linesLimit": { + "type": "number" + }, + "volumeLimit": { + "type": "number" + }, + "sizeLimit": { + "type": "number" } }, "relations": { From b592ccc1624542e0f9efc1c9dedca4d12566f3bd Mon Sep 17 00:00:00 2001 From: sergiodt Date: Tue, 15 Oct 2024 17:01:09 +0200 Subject: [PATCH 09/21] fix: refs #6861 getTickets --- back/methods/collection/getTickets.js | 6 ++++-- db/routines/vn/triggers/itemShelvingSale_afterInsert.sql | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/back/methods/collection/getTickets.js b/back/methods/collection/getTickets.js index 2a2b67524..48301a366 100644 --- a/back/methods/collection/getTickets.js +++ b/back/methods/collection/getTickets.js @@ -62,7 +62,8 @@ module.exports = Self => { p.code parkingCodePrevia, p.pickingOrder pickingOrderPrevia, iss.id itemShelvingSaleFk, - iss.isPicked + iss.isPicked, + iss.itemShelvingFk FROM ticketCollection tc LEFT JOIN collection c ON c.id = tc.collectionFk JOIN sale s ON s.ticketFk = tc.ticketFk @@ -102,7 +103,8 @@ module.exports = Self => { p.code, p.pickingOrder, iss.id itemShelvingSaleFk, - iss.isPicked + iss.isPicked, + iss.itemShelvingFk FROM sectorCollection sc JOIN sectorCollectionSaleGroup ss ON ss.sectorCollectionFk = sc.id JOIN saleGroup sg ON sg.id = ss.saleGroupFk diff --git a/db/routines/vn/triggers/itemShelvingSale_afterInsert.sql b/db/routines/vn/triggers/itemShelvingSale_afterInsert.sql index 3531b094c..5ad83d289 100644 --- a/db/routines/vn/triggers/itemShelvingSale_afterInsert.sql +++ b/db/routines/vn/triggers/itemShelvingSale_afterInsert.sql @@ -3,10 +3,10 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`itemShelvingSale_afterI AFTER INSERT ON `itemShelvingSale` FOR EACH ROW BEGIN - UPDATE sale s JOIN operator o ON o.workerFk = account.myUser_getId() - SET s.isPicked = IF(o.isOnReservationMode, s.isPicked, TRUE) + JOIN sector se ON s.id = o.sectorFk + SET s.isPicked = IF((se.isOnReservationMode IS NULL AND o.isOnReservationMode) OR se.isOnReservationMode, s.isPicked, TRUE) WHERE id = NEW.saleFk; END$$ DELIMITER ; \ No newline at end of file From 2adc424ccb3814a51a87e3b1cdfba0ca86b4da5e Mon Sep 17 00:00:00 2001 From: sergiodt Date: Tue, 15 Oct 2024 17:07:35 +0200 Subject: [PATCH 10/21] fix: refs #6861 getTickets --- db/routines/vn/triggers/itemShelvingSale_afterInsert.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/triggers/itemShelvingSale_afterInsert.sql b/db/routines/vn/triggers/itemShelvingSale_afterInsert.sql index 5ad83d289..1980691b5 100644 --- a/db/routines/vn/triggers/itemShelvingSale_afterInsert.sql +++ b/db/routines/vn/triggers/itemShelvingSale_afterInsert.sql @@ -5,7 +5,7 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`itemShelvingSale_afterI BEGIN UPDATE sale s JOIN operator o ON o.workerFk = account.myUser_getId() - JOIN sector se ON s.id = o.sectorFk + JOIN sector se ON se.id = o.sectorFk SET s.isPicked = IF((se.isOnReservationMode IS NULL AND o.isOnReservationMode) OR se.isOnReservationMode, s.isPicked, TRUE) WHERE id = NEW.saleFk; END$$ From 12abca0a2d2819e559e4d64a8ee147a89c278c00 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Tue, 15 Oct 2024 18:12:07 +0200 Subject: [PATCH 11/21] fix: refs #6861 getTickets --- db/routines/vn/triggers/itemShelvingSale_afterInsert.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/routines/vn/triggers/itemShelvingSale_afterInsert.sql b/db/routines/vn/triggers/itemShelvingSale_afterInsert.sql index 1980691b5..ad4a6f670 100644 --- a/db/routines/vn/triggers/itemShelvingSale_afterInsert.sql +++ b/db/routines/vn/triggers/itemShelvingSale_afterInsert.sql @@ -6,7 +6,7 @@ BEGIN UPDATE sale s JOIN operator o ON o.workerFk = account.myUser_getId() JOIN sector se ON se.id = o.sectorFk - SET s.isPicked = IF((se.isOnReservationMode IS NULL AND o.isOnReservationMode) OR se.isOnReservationMode, s.isPicked, TRUE) - WHERE id = NEW.saleFk; + SET s.isPicked = IF(IFNULL(se.isOnReservationMode, o.isOnReservationMode), s.isPicked, TRUE) + WHERE s.id = NEW.saleFk; END$$ DELIMITER ; \ No newline at end of file From c355fcfece4c201ae7ab183d4c1237530f26f755 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 16 Oct 2024 09:03:47 +0200 Subject: [PATCH 12/21] test(docuware_core): refs #8066 adapt --- back/methods/docuware/core.js | 4 +- back/methods/docuware/specs/core.spec.js | 164 ++++++++++++----------- 2 files changed, 86 insertions(+), 82 deletions(-) diff --git a/back/methods/docuware/core.js b/back/methods/docuware/core.js index 391a8b4ab..3de33b786 100644 --- a/back/methods/docuware/core.js +++ b/back/methods/docuware/core.js @@ -8,10 +8,10 @@ module.exports = Self => { */ Self.getOptions = async() => { const docuwareConfig = await Self.app.models.DocuwareConfig.findOne(); - const now = new Date().getTime(); + const now = Date.vnNow(); let {url, username, password, token, expired} = docuwareConfig; - if (!expired || expired < now + 60) { + if (process.env.NODE_ENV && (!expired || expired < now + 60)) { const {data: {IdentityServiceUrl}} = await axios.get(`${url}/Home/IdentityServiceInfo`); const {data: {token_endpoint}} = await axios.get(`${IdentityServiceUrl}/.well-known/openid-configuration`); const {data} = await axios.post(token_endpoint, { diff --git a/back/methods/docuware/specs/core.spec.js b/back/methods/docuware/specs/core.spec.js index cdf8a3b62..47580483d 100644 --- a/back/methods/docuware/specs/core.spec.js +++ b/back/methods/docuware/specs/core.spec.js @@ -2,87 +2,54 @@ const axios = require('axios'); const models = require('vn-loopback/server/server').models; describe('Docuware core', () => { - beforeAll(() => { + const fileCabinetCode = 'deliveryNote'; + beforeAll(async() => { process.env.NODE_ENV = 'testing'; - }); - afterAll(() => { - delete process.env.NODE_ENV; - }); - - describe('getOptions()', () => { - it('should return url and headers', async() => { - const result = await models.Docuware.getOptions(); - - expect(result.url).toBeDefined(); - expect(result.headers).toBeDefined(); + const docuwareInfo = await models.Docuware.findOne({ + where: { + code: fileCabinetCode + } }); - }); - describe('getDialog()', () => { - it('should return dialogId', async() => { - const dialogs = { - data: { - Dialog: [ - { - DisplayName: 'find', - Id: 'getDialogTest' - } - ] - } - }; - spyOn(axios, 'get').and.returnValue(new Promise(resolve => resolve(dialogs))); - const result = await models.Docuware.getDialog('deliveryNote', 'find', 'randomFileCabinetId'); + spyOn(axios, 'get').and.callFake(url => { + if (url.includes('IdentityServiceInfo')) return {data: {IdentityServiceUrl: 'IdentityServiceUrl'}}; + if (url.includes('IdentityServiceUrl')) return {data: {token_endpoint: 'token_endpoint'}}; + if (url.includes('dialogs')) { + return { + data: { + Dialog: [ + { + DisplayName: 'find', + Id: 'getDialogTest' + } + ] + } + }; + } - expect(result).toEqual('getDialogTest'); - }); - }); - - describe('getFileCabinet()', () => { - it('should return fileCabinetId', async() => { - const code = 'deliveryNote'; - const docuwareInfo = await models.Docuware.findOne({ - where: { - code - } - }); - const dialogs = { - data: { + if (url.includes('FileCabinets')) { + return {data: { FileCabinet: [ { Name: docuwareInfo.fileCabinetName, Id: 'getFileCabinetTest' } ] - } - }; - spyOn(axios, 'get').and.returnValue(new Promise(resolve => resolve(dialogs))); - const result = await models.Docuware.getFileCabinet(code); - - expect(result).toEqual('getFileCabinetTest'); - }); - }); - - describe('get()', () => { - it('should return data without parse', async() => { - spyOn(models.Docuware, 'getFileCabinet').and.returnValue((new Promise(resolve => resolve(Math.random())))); - spyOn(models.Docuware, 'getDialog').and.returnValue((new Promise(resolve => resolve(Math.random())))); - const data = { - data: { - id: 1 - } - }; - spyOn(axios, 'post').and.returnValue(new Promise(resolve => resolve(data))); - const result = await models.Docuware.get('deliveryNote'); - - expect(result.id).toEqual(1); + }}; + } }); - it('should return data with parse', async() => { - spyOn(models.Docuware, 'getFileCabinet').and.returnValue((new Promise(resolve => resolve(Math.random())))); - spyOn(models.Docuware, 'getDialog').and.returnValue((new Promise(resolve => resolve(Math.random())))); - const data = { - data: { + spyOn(axios, 'post').and.callFake(url => { + if (url.includes('token_endpoint')) { + return {data: { + access_token: 'access_token', + token_type: 'bearer', + expires_in: 10000 + }}; + } + if (url.includes('DialogExpression')) { + return {data: { Items: [{ Fields: [ { @@ -103,12 +70,52 @@ describe('Docuware core', () => { ] }] } - }; + }; + } + }); + }); + + afterAll(() => { + delete process.env.NODE_ENV; + }); + + describe('getOptions()', () => { + it('should return url and headers', async() => { + const result = await models.Docuware.getOptions(); + + expect(result.url).toBeDefined(); + expect(result.headers).toBeDefined(); + }); + }); + + describe('Dialog()', () => { + it('should return dialogId', async() => { + const result = await models.Docuware.getDialog('deliveryNote', 'find', 'randomFileCabinetId'); + + expect(result).toEqual('getDialogTest'); + }); + }); + + describe('getFileCabinet()', () => { + it('should return fileCabinetId', async() => { + const result = await models.Docuware.getFileCabinet(fileCabinetCode); + + expect(result).toEqual('getFileCabinetTest'); + }); + }); + + describe('get()', () => { + it('should return data without parse', async() => { + const [result] = await models.Docuware.get('deliveryNote'); + + expect(result.firstRequiredField).toEqual(1); + }); + + it('should return data with parse', async() => { const parse = { 'firstRequiredField': 'id', 'secondRequiredField': 'name', }; - spyOn(axios, 'post').and.returnValue(new Promise(resolve => resolve(data))); const [result] = await models.Docuware.get('deliveryNote', null, parse); expect(result.id).toEqual(1); @@ -119,17 +126,14 @@ describe('Docuware core', () => { describe('getById()', () => { it('should return data', async() => { - spyOn(models.Docuware, 'getFileCabinet').and.returnValue((new Promise(resolve => resolve(Math.random())))); - spyOn(models.Docuware, 'getDialog').and.returnValue((new Promise(resolve => resolve(Math.random())))); - const data = { - data: { - id: 1 - } - }; - spyOn(axios, 'post').and.returnValue(new Promise(resolve => resolve(data))); - const result = await models.Docuware.getById('deliveryNote', 1); + spyOn(models.Docuware, 'get'); + await models.Docuware.getById('deliveryNote', 1); - expect(result.id).toEqual(1); + expect(models.Docuware.get).toHaveBeenCalledWith( + 'deliveryNote', + {condition: [Object({DBName: 'N__ALBAR_N', Value: [1]})]}, + undefined + ); }); }); }); From 8f01e4d110ad040c33674bb5b51664d0e3dd93be Mon Sep 17 00:00:00 2001 From: jorgep Date: Wed, 16 Oct 2024 09:32:15 +0200 Subject: [PATCH 13/21] fix: refs #7353 redirect to lilium --- modules/monitor/front/locale/es.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 modules/monitor/front/locale/es.yml diff --git a/modules/monitor/front/locale/es.yml b/modules/monitor/front/locale/es.yml new file mode 100644 index 000000000..01b26b70c --- /dev/null +++ b/modules/monitor/front/locale/es.yml @@ -0,0 +1,16 @@ +Tickets monitor: Monitor de tickets +Clients on website: Clientes activos en la web +Recent order actions: Acciones recientes en pedidos +Search tickets: Buscar tickets +Delete selected elements: Eliminar los elementos seleccionados +All the selected elements will be deleted. Are you sure you want to continue?: Todos los elementos seleccionados serán eliminados. ¿Seguro que quieres continuar? +Component lack: Faltan componentes +Ticket too little: Ticket demasiado pequeño +Minimize/Maximize: Minimizar/Maximizar +Problems: Problemas +Theoretical: Teórica +Practical: Práctica +Preparation: Preparación +Auto-refresh: Auto-refresco +Toggle auto-refresh every 2 minutes: Conmuta el refresco automático cada 2 minutos +Is fragile: Es frágil \ No newline at end of file From 3e443ad5ced8090ee005bfa79add11e60c30a654 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 16 Oct 2024 12:22:57 +0200 Subject: [PATCH 14/21] fix: refs #7230 producer fix --- print/templates/reports/delivery-note/delivery-note.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/print/templates/reports/delivery-note/delivery-note.html b/print/templates/reports/delivery-note/delivery-note.html index c1701e084..ccf2fbfb4 100644 --- a/print/templates/reports/delivery-note/delivery-note.html +++ b/print/templates/reports/delivery-note/delivery-note.html @@ -58,6 +58,7 @@ {{$t('reference')}} {{$t('quantity')}} {{$t('concept')}} + {{$t('producer')}} {{$t('price')}} {{$t('discount')}} {{$t('vat')}} @@ -69,7 +70,7 @@ {{sale.itemFk}} {{sale.quantity}} {{sale.concept}} - {{sale.price | currency('EUR', $i18n.locale)}} + {{sale.subName}} {{(sale.discount / 100) | percentage}} {{sale.vatType}} @@ -81,7 +82,6 @@ {{sale.tag5}} {{sale.value5}} {{sale.tag6}} {{sale.value6}} {{sale.tag7}} {{sale.value7}} - {{$t('producer')}} {{ sale.subName }} From 5de4a11e8b2a236bb4055253fa1c19dd9ae04e80 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 16 Oct 2024 13:53:20 +0200 Subject: [PATCH 15/21] fix: refs #7230 fix line --- print/templates/reports/delivery-note/delivery-note.html | 1 + 1 file changed, 1 insertion(+) diff --git a/print/templates/reports/delivery-note/delivery-note.html b/print/templates/reports/delivery-note/delivery-note.html index ccf2fbfb4..89bc07488 100644 --- a/print/templates/reports/delivery-note/delivery-note.html +++ b/print/templates/reports/delivery-note/delivery-note.html @@ -71,6 +71,7 @@ {{sale.quantity}} {{sale.concept}} {{sale.subName}} + {{sale.price | currency('EUR', $i18n.locale)}} {{(sale.discount / 100) | percentage}} {{sale.vatType}} From a188efb1e33d24e5a70f6301f6b739b3d93de12b Mon Sep 17 00:00:00 2001 From: guillermo Date: Thu, 17 Oct 2024 11:45:13 +0200 Subject: [PATCH 16/21] refactor: refs #7930 Deleted HEALTHCHECK of back dockerfile --- back/Dockerfile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/back/Dockerfile b/back/Dockerfile index 363192a0b..3e2a90c58 100644 --- a/back/Dockerfile +++ b/back/Dockerfile @@ -55,7 +55,4 @@ COPY \ README.md \ ./ -CMD ["pm2-runtime", "./back/process.yml"] - -HEALTHCHECK --interval=15s --timeout=10s \ - CMD curl -f http://localhost:3000/api/Applications/status || exit 1 +CMD ["pm2-runtime", "./back/process.yml"] \ No newline at end of file From cb539624056c6d88d182b27745daec7334c40eb9 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Thu, 17 Oct 2024 13:58:21 +0200 Subject: [PATCH 17/21] fix: refs #6861 saleTrackingAdd --- ...saleTracking_sectorCollectionAddPrevOK.sql | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 db/routines/vn/procedures/saleTracking_sectorCollectionAddPrevOK.sql diff --git a/db/routines/vn/procedures/saleTracking_sectorCollectionAddPrevOK.sql b/db/routines/vn/procedures/saleTracking_sectorCollectionAddPrevOK.sql new file mode 100644 index 000000000..3ac31752a --- /dev/null +++ b/db/routines/vn/procedures/saleTracking_sectorCollectionAddPrevOK.sql @@ -0,0 +1,26 @@ +DELIMITER $$ +CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`saleTracking_sectorCollectionAddPrevOK`(vSectorCollectionFk INT) +BEGIN +/** + * Inserta los registros de sectorCollection con el estado PREVIA OK si la reserva está picked + * + * @param vSectorCollectionFk Identificador de vn.sectorCollection + */ + REPLACE saleTracking( + saleFk, + isChecked, + workerFk, + stateFk + ) + SELECT sgd.saleFk, + TRUE, + sc.userFk, + s.id + FROM vn.sectorCollection sc + JOIN sectorCollectionSaleGroup scsg ON scsg.sectorCollectionFk = sc.id + JOIN saleGroupDetail sgd ON sgd.saleGroupFk = scsg.saleGroupFk + JOIN state s ON s.code = 'OK PREVIOUS' + JOIN itemShelvingSale iss ON iss.saleFk = sgd.saleFk + WHERE sc.id = vSectorCollectionFk AND iss.isPicked; +END$$ +DELIMITER ; From 63c0ec308f3231fbc276c7e3ee365cdc2464d5c7 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Thu, 17 Oct 2024 17:01:44 +0200 Subject: [PATCH 18/21] fix: refs #6861 saleTrackingAdd --- ...saleTracking_sectorCollectionAddPrevOK.sql | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/db/routines/vn/procedures/saleTracking_sectorCollectionAddPrevOK.sql b/db/routines/vn/procedures/saleTracking_sectorCollectionAddPrevOK.sql index 3ac31752a..a5d34c2d6 100644 --- a/db/routines/vn/procedures/saleTracking_sectorCollectionAddPrevOK.sql +++ b/db/routines/vn/procedures/saleTracking_sectorCollectionAddPrevOK.sql @@ -1,5 +1,7 @@ DELIMITER $$ -CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`saleTracking_sectorCollectionAddPrevOK`(vSectorCollectionFk INT) +CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`saleTracking_sectorCollectionAddPrevOK`( + vSectorCollectionFk INT + ) BEGIN /** * Inserta los registros de sectorCollection con el estado PREVIA OK si la reserva está picked @@ -12,15 +14,15 @@ BEGIN workerFk, stateFk ) - SELECT sgd.saleFk, - TRUE, - sc.userFk, - s.id - FROM vn.sectorCollection sc - JOIN sectorCollectionSaleGroup scsg ON scsg.sectorCollectionFk = sc.id - JOIN saleGroupDetail sgd ON sgd.saleGroupFk = scsg.saleGroupFk - JOIN state s ON s.code = 'OK PREVIOUS' - JOIN itemShelvingSale iss ON iss.saleFk = sgd.saleFk - WHERE sc.id = vSectorCollectionFk AND iss.isPicked; + SELECT sgd.saleFk, + TRUE, + sc.userFk, + s.id + FROM sectorCollection sc + JOIN sectorCollectionSaleGroup scsg ON scsg.sectorCollectionFk = sc.id + JOIN saleGroupDetail sgd ON sgd.saleGroupFk = scsg.saleGroupFk + JOIN state s ON s.code = 'OK PREVIOUS' + JOIN itemShelvingSale iss ON iss.saleFk = sgd.saleFk + WHERE sc.id = vSectorCollectionFk AND iss.isPicked; END$$ DELIMITER ; From 7dc35458e8973188cf4b968f335c438b378e85e5 Mon Sep 17 00:00:00 2001 From: ivanm Date: Thu, 17 Oct 2024 17:05:08 +0200 Subject: [PATCH 19/21] refactor: refs #7865 delete client.gestdocFk from TPV --- db/dump/fixtures.before.sql | 30 +++++++++---------- db/routines/vn2008/views/Clientes.sql | 1 - db/versions/11311-tealFern/00-firstScript.sql | 1 + 3 files changed, 16 insertions(+), 16 deletions(-) create mode 100644 db/versions/11311-tealFern/00-firstScript.sql diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index 7f7e50dd3..a6852be7e 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -388,23 +388,23 @@ INSERT INTO `vn`.`contactChannel`(`id`, `name`) (4, 'GCN Channel'), (5, 'The Newspaper'); -INSERT INTO `vn`.`client`(`id`,`name`,`fi`,`socialName`,`contact`,`street`,`city`,`postcode`,`phone`,`mobile`,`isRelevant`,`email`,`iban`,`dueDay`,`accountingAccount`,`isEqualizated`,`provinceFk`,`hasToInvoice`,`credit`,`countryFk`,`isActive`,`gestdocFk`,`quality`,`payMethodFk`,`created`,`isToBeMailed`,`contactChannelFk`,`hasSepaVnl`,`hasCoreVnl`,`hasCoreVnh`,`riskCalculated`, `hasToInvoiceByAddress`,`isTaxDataChecked`,`isFreezed`,`creditInsurance`,`isCreatedAsServed`,`hasInvoiceSimplified`,`salesPersonFk`,`isVies`,`businessTypeFk`,`typeFk`) +INSERT INTO `vn`.`client`(`id`,`name`,`fi`,`socialName`,`contact`,`street`,`city`,`postcode`,`phone`,`mobile`,`isRelevant`,`email`,`iban`,`dueDay`,`accountingAccount`,`isEqualizated`,`provinceFk`,`hasToInvoice`,`credit`,`countryFk`,`isActive`,`quality`,`payMethodFk`,`created`,`isToBeMailed`,`contactChannelFk`,`hasSepaVnl`,`hasCoreVnl`,`hasCoreVnh`,`riskCalculated`, `hasToInvoiceByAddress`,`isTaxDataChecked`,`isFreezed`,`creditInsurance`,`isCreatedAsServed`,`hasInvoiceSimplified`,`salesPersonFk`,`isVies`,`businessTypeFk`,`typeFk`) VALUES - (1101, 'Bruce Wayne', '84612325V', 'BATMAN', 'Alfred', '1007 MOUNTAIN DRIVE, GOTHAM', 'Gotham', 46460, 1111111111, 222222222, 1, 'BruceWayne@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, NULL, 0, 0, 18, 0, 'florist','normal'), - (1102, 'Petter Parker', '87945234L', 'SPIDER MAN', 'Aunt May', '20 INGRAM STREET, QUEENS, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'PetterParker@mydomain.com', NULL, 0, 1234567890, 0, 2, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, NULL, 0, 0, 18, 0, 'florist','normal'), - (1103, 'Clark Kent', '06815934E', 'SUPER MAN', 'lois lane', '344 CLINTON STREET, APARTAMENT 3-D', 'Gotham', 46460, 1111111111, 222222222, 1, 'ClarkKent@mydomain.com', NULL, 0, 1234567890, 0, 3, 1, 0, 19, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, NULL, 0, 0, 18, 0, 'florist','normal'), - (1104, 'Tony Stark', '06089160W', 'IRON MAN', 'Pepper Potts', '10880 MALIBU POINT, 90265', 'Gotham', 46460, 1111111111, 222222222, 1, 'TonyStark@mydomain.com', NULL, 0, 1234567890, 0, 2, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, NULL, 0, 0, 18, 0, 'florist','normal'), - (1105, 'Max Eisenhardt', '251628698', 'MAGNETO', 'Rogue', 'UNKNOWN WHEREABOUTS', 'Gotham', 46460, 1111111111, 222222222, 1, 'MaxEisenhardt@mydomain.com', NULL, 0, 1234567890, 0, 3, 1, 300, 8, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, NULL, 0, 0, 18, 0, 'florist','normal'), - (1106, 'DavidCharlesHaller', '53136686Q', 'LEGION', 'Charles Xavier', 'CITY OF NEW YORK, NEW YORK, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'DavidCharlesHaller@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 0, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, NULL, 0, 0, 19, 0, 'florist','normal'), - (1107, 'Hank Pym', '09854837G', 'ANT MAN', 'Hawk', 'ANTHILL, SAN FRANCISCO, CALIFORNIA', 'Gotham', 46460, 1111111111, 222222222, 1, 'HankPym@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 0, 0, NULL, 0, 0, 19, 0, 'florist','normal'), - (1108, 'Charles Xavier', '22641921P', 'PROFESSOR X', 'Beast', '3800 VICTORY PKWY, CINCINNATI, OH 45207, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'CharlesXavier@mydomain.com', NULL, 0, 1234567890, 0, 5, 1, 300, 13, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, NULL, 0, 0, 19, 0, 'florist','normal'), - (1109, 'Bruce Banner', '16104829E', 'HULK', 'Black widow', 'SOMEWHERE IN NEW YORK', 'Gotham', 46460, 1111111111, 222222222, 1, 'BruceBanner@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 0, 0, NULL, 0, 0, 9, 0, 'florist','normal'), - (1110, 'Jessica Jones', '58282869H', 'JESSICA JONES', 'Luke Cage', 'NYCC 2015 POSTER', 'Gotham', 46460, 1111111111, 222222222, 1, 'JessicaJones@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, NULL, 0, 0, NULL, 1, 'florist','normal'), - (1111, 'Missing', NULL, 'MISSING MAN', 'Anton', 'THE SPACE, UNIVERSE FAR AWAY', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 0, 1, 0, NULL, 1, 0, NULL, 0, 'others','loses'), - (1112, 'Trash', NULL, 'GARBAGE MAN', 'Unknown name', 'NEW YORK CITY, UNDERGROUND', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 0, 1, 0, NULL, 1, 0, NULL, 0, 'others','loses'); + (1101, 'Bruce Wayne', '84612325V', 'BATMAN', 'Alfred', '1007 MOUNTAIN DRIVE, GOTHAM', 'Gotham', 46460, 1111111111, 222222222, 1, 'BruceWayne@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, NULL, 0, 0, 18, 0, 'florist','normal'), + (1102, 'Petter Parker', '87945234L', 'SPIDER MAN', 'Aunt May', '20 INGRAM STREET, QUEENS, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'PetterParker@mydomain.com', NULL, 0, 1234567890, 0, 2, 1, 300, 1, 1, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, NULL, 0, 0, 18, 0, 'florist','normal'), + (1103, 'Clark Kent', '06815934E', 'SUPER MAN', 'lois lane', '344 CLINTON STREET, APARTAMENT 3-D', 'Gotham', 46460, 1111111111, 222222222, 1, 'ClarkKent@mydomain.com', NULL, 0, 1234567890, 0, 3, 1, 0, 19, 1, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, NULL, 0, 0, 18, 0, 'florist','normal'), + (1104, 'Tony Stark', '06089160W', 'IRON MAN', 'Pepper Potts', '10880 MALIBU POINT, 90265', 'Gotham', 46460, 1111111111, 222222222, 1, 'TonyStark@mydomain.com', NULL, 0, 1234567890, 0, 2, 1, 300, 1, 1, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, NULL, 0, 0, 18, 0, 'florist','normal'), + (1105, 'Max Eisenhardt', '251628698', 'MAGNETO', 'Rogue', 'UNKNOWN WHEREABOUTS', 'Gotham', 46460, 1111111111, 222222222, 1, 'MaxEisenhardt@mydomain.com', NULL, 0, 1234567890, 0, 3, 1, 300, 8, 1, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, NULL, 0, 0, 18, 0, 'florist','normal'), + (1106, 'DavidCharlesHaller', '53136686Q', 'LEGION', 'Charles Xavier', 'CITY OF NEW YORK, NEW YORK, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'DavidCharlesHaller@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 0, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, NULL, 0, 0, 19, 0, 'florist','normal'), + (1107, 'Hank Pym', '09854837G', 'ANT MAN', 'Hawk', 'ANTHILL, SAN FRANCISCO, CALIFORNIA', 'Gotham', 46460, 1111111111, 222222222, 1, 'HankPym@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 0, 0, NULL, 0, 0, 19, 0, 'florist','normal'), + (1108, 'Charles Xavier', '22641921P', 'PROFESSOR X', 'Beast', '3800 VICTORY PKWY, CINCINNATI, OH 45207, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'CharlesXavier@mydomain.com', NULL, 0, 1234567890, 0, 5, 1, 300, 13, 1, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, NULL, 0, 0, 19, 0, 'florist','normal'), + (1109, 'Bruce Banner', '16104829E', 'HULK', 'Black widow', 'SOMEWHERE IN NEW YORK', 'Gotham', 46460, 1111111111, 222222222, 1, 'BruceBanner@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 0, 0, NULL, 0, 0, 9, 0, 'florist','normal'), + (1110, 'Jessica Jones', '58282869H', 'JESSICA JONES', 'Luke Cage', 'NYCC 2015 POSTER', 'Gotham', 46460, 1111111111, 222222222, 1, 'JessicaJones@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, NULL, 0, 0, NULL, 1, 'florist','normal'), + (1111, 'Missing', NULL, 'MISSING MAN', 'Anton', 'THE SPACE, UNIVERSE FAR AWAY', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 0, 1, 0, NULL, 1, 0, NULL, 0, 'others','loses'), + (1112, 'Trash', NULL, 'GARBAGE MAN', 'Unknown name', 'NEW YORK CITY, UNDERGROUND', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 0, 1, 0, NULL, 1, 0, NULL, 0, 'others','loses'); -INSERT INTO `vn`.`client`(`id`, `name`, `fi`, `socialName`, `contact`, `street`, `city`, `postcode`, `isRelevant`, `email`, `iban`,`dueDay`,`accountingAccount`, `isEqualizated`, `provinceFk`, `hasToInvoice`, `credit`, `countryFk`, `isActive`, `gestdocFk`, `quality`, `payMethodFk`,`created`, `isTaxDataChecked`) - SELECT id, name, CONCAT(RPAD(CONCAT(id,9),8,id),'A'), UPPER(CONCAT(name, 'Social')), CONCAT(name, 'Contact'), CONCAT(name, 'Street'), 'GOTHAM', 46460, 1, CONCAT(name,'@mydomain.com'), NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5, util.VN_CURDATE(), 1 +INSERT INTO `vn`.`client`(`id`, `name`, `fi`, `socialName`, `contact`, `street`, `city`, `postcode`, `isRelevant`, `email`, `iban`,`dueDay`,`accountingAccount`, `isEqualizated`, `provinceFk`, `hasToInvoice`, `credit`, `countryFk`, `isActive`, `quality`, `payMethodFk`,`created`, `isTaxDataChecked`) + SELECT id, name, CONCAT(RPAD(CONCAT(id,9),8,id),'A'), UPPER(CONCAT(name, 'Social')), CONCAT(name, 'Contact'), CONCAT(name, 'Street'), 'GOTHAM', 46460, 1, CONCAT(name,'@mydomain.com'), NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, 10, 5, util.VN_CURDATE(), 1 FROM `account`.`role` `r` WHERE `r`.`hasLogin` = 1; diff --git a/db/routines/vn2008/views/Clientes.sql b/db/routines/vn2008/views/Clientes.sql index 153d875bc..9f8ef712e 100644 --- a/db/routines/vn2008/views/Clientes.sql +++ b/db/routines/vn2008/views/Clientes.sql @@ -22,7 +22,6 @@ AS SELECT `c`.`id` AS `id_cliente`, `c`.`credit` AS `credito`, `c`.`countryFk` AS `Id_Pais`, `c`.`isActive` AS `activo`, - `c`.`gestdocFk` AS `gestdoc_id`, `c`.`quality` AS `calidad`, `c`.`payMethodFk` AS `pay_met_id`, `c`.`created` AS `created`, diff --git a/db/versions/11311-tealFern/00-firstScript.sql b/db/versions/11311-tealFern/00-firstScript.sql new file mode 100644 index 000000000..909747f3c --- /dev/null +++ b/db/versions/11311-tealFern/00-firstScript.sql @@ -0,0 +1 @@ +ALTER TABLE vn.client CHANGE gestdocFk gestdocFk__ int(11) DEFAULT NULL NULL COMMENT '@deprecated 2024-10-17'; \ No newline at end of file From 34630360866759b5bce57227b5581d203abf98ed Mon Sep 17 00:00:00 2001 From: sergiodt Date: Thu, 17 Oct 2024 17:20:21 +0200 Subject: [PATCH 20/21] fix: refs #6861 saleTrackingAdd --- .../saleTracking_sectorCollectionAddPrevOK.sql | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/db/routines/vn/procedures/saleTracking_sectorCollectionAddPrevOK.sql b/db/routines/vn/procedures/saleTracking_sectorCollectionAddPrevOK.sql index a5d34c2d6..003168ec8 100644 --- a/db/routines/vn/procedures/saleTracking_sectorCollectionAddPrevOK.sql +++ b/db/routines/vn/procedures/saleTracking_sectorCollectionAddPrevOK.sql @@ -1,23 +1,15 @@ DELIMITER $$ CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`saleTracking_sectorCollectionAddPrevOK`( vSectorCollectionFk INT - ) +) BEGIN /** * Inserta los registros de sectorCollection con el estado PREVIA OK si la reserva está picked * * @param vSectorCollectionFk Identificador de vn.sectorCollection */ - REPLACE saleTracking( - saleFk, - isChecked, - workerFk, - stateFk - ) - SELECT sgd.saleFk, - TRUE, - sc.userFk, - s.id + REPLACE saleTracking(saleFk, isChecked, workerFk, stateFk) + SELECT sgd.saleFk, TRUE, sc.userFk, s.id FROM sectorCollection sc JOIN sectorCollectionSaleGroup scsg ON scsg.sectorCollectionFk = sc.id JOIN saleGroupDetail sgd ON sgd.saleGroupFk = scsg.saleGroupFk From 93494c3eb05ad06cab9102cc06ebdebac06dab85 Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 18 Oct 2024 08:02:06 +0200 Subject: [PATCH 21/21] refactor: refs #7811 Deleted pm2 --- back/Dockerfile | 5 ++--- back/process.yml | 7 ------- 2 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 back/process.yml diff --git a/back/Dockerfile b/back/Dockerfile index 3e2a90c58..0f75f6949 100644 --- a/back/Dockerfile +++ b/back/Dockerfile @@ -32,8 +32,7 @@ RUN apt-get update \ RUN apt-get update \ && apt-get install -y --no-install-recommends \ samba-common-bin samba-dsdb-modules\ - && rm -rf /var/lib/apt/lists/* \ - && npm -g install pm2 + && rm -rf /var/lib/apt/lists/* # Salix @@ -55,4 +54,4 @@ COPY \ README.md \ ./ -CMD ["pm2-runtime", "./back/process.yml"] \ No newline at end of file +CMD ["node", "--tls-min-v1.0", "--openssl-legacy-provider", "./loopback/server/server.js"] \ No newline at end of file diff --git a/back/process.yml b/back/process.yml deleted file mode 100644 index 94072b57d..000000000 --- a/back/process.yml +++ /dev/null @@ -1,7 +0,0 @@ -apps: - - script: ./loopback/server/server.js - name: salix-back - instances: 1 - max_restarts: 0 - autorestart: false - node_args: --tls-min-v1.0 --openssl-legacy-provider