From bca9e757d420eb587da1ea6742f16068873d442d Mon Sep 17 00:00:00 2001 From: alexandre Date: Thu, 23 Feb 2023 15:52:47 +0100 Subject: [PATCH 1/3] hotfix parsed description array to string --- e2e/paths/05-ticket/18_index_payout.spec.js | 2 +- modules/client/front/balance/create/index.js | 2 +- modules/client/front/balance/create/index.spec.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/e2e/paths/05-ticket/18_index_payout.spec.js b/e2e/paths/05-ticket/18_index_payout.spec.js index 89b5937a1..220dacf61 100644 --- a/e2e/paths/05-ticket/18_index_payout.spec.js +++ b/e2e/paths/05-ticket/18_index_payout.spec.js @@ -63,6 +63,6 @@ describe('Ticket index payout path', () => { const reference = await page.waitToGetProperty(selectors.clientBalance.firstLineReference, 'innerText'); expect(count).toEqual(4); - expect(reference).toContain('Cash,Albaran: 7, 8Payment'); + expect(reference).toContain('Cash, Albaran: 7, 8Payment'); }); }); diff --git a/modules/client/front/balance/create/index.js b/modules/client/front/balance/create/index.js index ef22c968a..cc9e1ab5a 100644 --- a/modules/client/front/balance/create/index.js +++ b/modules/client/front/balance/create/index.js @@ -68,7 +68,7 @@ class Controller extends Dialog { this.receipt.description.push(accountingType.receiptDescription); if (this.originalDescription) this.receipt.description.push(this.originalDescription); - this.receipt.description.join(', '); + this.receipt.description = this.receipt.description.join(', '); } this.maxAmount = accountingType && accountingType.maxAmount; diff --git a/modules/client/front/balance/create/index.spec.js b/modules/client/front/balance/create/index.spec.js index 408e6b66a..fa6b48ea4 100644 --- a/modules/client/front/balance/create/index.spec.js +++ b/modules/client/front/balance/create/index.spec.js @@ -38,7 +38,7 @@ describe('Client', () => { } }; - expect(controller.receipt.description.join(',')).toEqual('Cash,Albaran: 1, 2'); + expect(controller.receipt.description).toEqual('Cash, Albaran: 1, 2'); }); }); From 9336d20e450a58d2d5455def95feae6bcc8dbd04 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 28 Feb 2023 13:45:36 +0100 Subject: [PATCH 2/3] refs #4975 MdbVersion/upload fixes & code clean --- modules/mdb/back/methods/mdbVersion/upload.js | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/modules/mdb/back/methods/mdbVersion/upload.js b/modules/mdb/back/methods/mdbVersion/upload.js index 864a73f52..ad158a551 100644 --- a/modules/mdb/back/methods/mdbVersion/upload.js +++ b/modules/mdb/back/methods/mdbVersion/upload.js @@ -47,7 +47,16 @@ module.exports = Self => { verb: 'POST' } }); - Self.upload = async(ctx, options) => { + Self.upload = async( + ctx, + options, + appName, + toVersion, + branch, + fromVersion, + description, + unlock + ) => { const models = Self.app.models; const myOptions = {}; const $t = ctx.req.__; // $translate @@ -55,12 +64,6 @@ module.exports = Self => { const AccessContainer = models.AccessContainer; const fileOptions = {}; let tx; - const appName = ctx.args.appName; - const toVersion = ctx.args.toVersion; - const branch = ctx.args.branch; - const fromVersion = ctx.args.fromVersion; - let description = ctx.args.description; - const unlock = ctx.args.unlock; if (typeof options == 'object') Object.assign(myOptions, options); @@ -153,11 +156,14 @@ module.exports = Self => { formatDesc += `*${appName.toUpperCase()}* v.${toVersion} `; const oldVersion = await models.MdbVersionTree.findOne({ - where: {version: fromVersion}, + where: { + version: fromVersion, + app: appName + }, fields: ['branchFk'] }, myOptions); - if (branch == oldVersion.branchFk) + if (!oldVersion || branch == oldVersion.branchFk) formatDesc += `[*${branch}*]: `; else formatDesc += `[*${oldVersion.branchFk}* » *${branch}*]: `; From 656685cd7eaa290e70ef952e6e00254e2bf8a987 Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 28 Feb 2023 14:35:34 +0100 Subject: [PATCH 3/3] refs #4975 Minor changes --- loopback/locale/es.json | 12 ++++++------ modules/mdb/back/methods/mdbVersion/upload.js | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/loopback/locale/es.json b/loopback/locale/es.json index ad6d53d64..11412bf5a 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -259,10 +259,10 @@ "Aplicación bloqueada por el usuario 9": "Aplicación bloqueada por el usuario 9", "Failed to upload file": "Error al subir archivo", "The DOCUWARE PDF document does not exists": "El documento PDF Docuware no existe", - "It is not possible to modify tracked sales": "No es posible modificar líneas de pedido que se hayan empezado a preparar", - "It is not possible to modify sales that their articles are from Floramondo": "No es posible modificar líneas de pedido cuyos artículos sean de Floramondo", - "It is not possible to modify cloned sales": "No es posible modificar líneas de pedido clonadas", + "It is not possible to modify tracked sales": "No es posible modificar líneas de pedido que se hayan empezado a preparar", + "It is not possible to modify sales that their articles are from Floramondo": "No es posible modificar líneas de pedido cuyos artículos sean de Floramondo", + "It is not possible to modify cloned sales": "No es posible modificar líneas de pedido clonadas", "A supplier with the same name already exists. Change the country.": "Un proveedor con el mismo nombre ya existe. Cambie el país.", - "There is no assigned email for this client": "No hay correo asignado para este cliente" -} - + "There is no assigned email for this client": "No hay correo asignado para este cliente", + "Not exist this branch": "Not exist this branch" +} \ No newline at end of file diff --git a/modules/mdb/back/methods/mdbVersion/upload.js b/modules/mdb/back/methods/mdbVersion/upload.js index ad158a551..58fc46abb 100644 --- a/modules/mdb/back/methods/mdbVersion/upload.js +++ b/modules/mdb/back/methods/mdbVersion/upload.js @@ -49,13 +49,13 @@ module.exports = Self => { }); Self.upload = async( ctx, - options, appName, toVersion, branch, fromVersion, description, - unlock + unlock, + options ) => { const models = Self.app.models; const myOptions = {};