From f3c7b1e89ca87b56b9e83374a11ba6ab3134f4a4 Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 29 Apr 2024 11:59:51 +0200 Subject: [PATCH 1/3] refs #6870 add observationEmail --- loopback/locale/es.json | 4 ++-- modules/client/back/methods/defaulter/observationEmail.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/loopback/locale/es.json b/loopback/locale/es.json index d7f9564fe..afb6aae3d 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -277,7 +277,7 @@ "Collection does not exist": "La colección no existe", "Cannot obtain exclusive lock": "No se puede obtener un bloqueo exclusivo", "Insert a date range": "Inserte un rango de fechas", - "Added observation": "{{user}} añadió esta observacion: {{text}}", + "Added observation": "{{user}} añadió esta observacion: {{text}} {defaulterUrl}", "Comment added to client": "Observación añadida al cliente {{clientFk}}", "Invalid auth code": "Código de verificación incorrecto", "Invalid or expired verification code": "Código de verificación incorrecto o expirado", @@ -354,4 +354,4 @@ "They're not your subordinate": "No es tu subordinado/a.", "No results found": "No se han encontrado resultados", "InvoiceIn is already booked": "La factura recibida está contabilizada" -} \ No newline at end of file +} diff --git a/modules/client/back/methods/defaulter/observationEmail.js b/modules/client/back/methods/defaulter/observationEmail.js index 5ac00b4ee..5b13e8282 100644 --- a/modules/client/back/methods/defaulter/observationEmail.js +++ b/modules/client/back/methods/defaulter/observationEmail.js @@ -29,6 +29,7 @@ module.exports = Self => { const $t = ctx.req.__; // $translate const myOptions = {}; const userId = ctx.req.accessToken.userId; + const url = await Self.app.models.Url.getUrl(); if (typeof options == 'object') Object.assign(myOptions, options); @@ -38,7 +39,8 @@ module.exports = Self => { const body = $t('Added observation', { user: user.name, - text: observation + text: observation, + defaulterUrl: `${url}client/${defaulter.clientFk}/summary` }); await models.Mail.create({ -- 2.40.1 From ae15f4b5d1836e69db02193b495c0881ed2f01f8 Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 2 May 2024 12:14:39 +0200 Subject: [PATCH 2/3] refs #6870 markdown --- loopback/locale/es.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loopback/locale/es.json b/loopback/locale/es.json index bc469523d..35b373795 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -277,7 +277,7 @@ "Collection does not exist": "La colección no existe", "Cannot obtain exclusive lock": "No se puede obtener un bloqueo exclusivo", "Insert a date range": "Inserte un rango de fechas", - "Added observation": "{{user}} añadió esta observacion: {{text}} {defaulterUrl}", + "Added observation": "{{user}} añadió esta observacion: {{text}} [{{clientFk}}]({{{defaulterUrl}}})", "Comment added to client": "Observación añadida al cliente {{clientFk}}", "Invalid auth code": "Código de verificación incorrecto", "Invalid or expired verification code": "Código de verificación incorrecto o expirado", -- 2.40.1 From def15211310f8dff5f5c9223eb22796352877cc0 Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 2 May 2024 12:42:17 +0200 Subject: [PATCH 3/3] refs #6870 defaulter id --- loopback/locale/es.json | 2 +- modules/client/back/methods/defaulter/observationEmail.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 35b373795..f1c57455e 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -277,7 +277,7 @@ "Collection does not exist": "La colección no existe", "Cannot obtain exclusive lock": "No se puede obtener un bloqueo exclusivo", "Insert a date range": "Inserte un rango de fechas", - "Added observation": "{{user}} añadió esta observacion: {{text}} [{{clientFk}}]({{{defaulterUrl}}})", + "Added observation": "{{user}} añadió esta observacion: {{text}} {{defaulterId}} ({{{defaulterUrl}}})", "Comment added to client": "Observación añadida al cliente {{clientFk}}", "Invalid auth code": "Código de verificación incorrecto", "Invalid or expired verification code": "Código de verificación incorrecto o expirado", diff --git a/modules/client/back/methods/defaulter/observationEmail.js b/modules/client/back/methods/defaulter/observationEmail.js index 5b13e8282..c06d1d3d0 100644 --- a/modules/client/back/methods/defaulter/observationEmail.js +++ b/modules/client/back/methods/defaulter/observationEmail.js @@ -40,6 +40,7 @@ module.exports = Self => { const body = $t('Added observation', { user: user.name, text: observation, + defaulterId: defaulter.clientFk, defaulterUrl: `${url}client/${defaulter.clientFk}/summary` }); -- 2.40.1