From 34fb80beec8468d1d43e3673d11598003cde26a2 Mon Sep 17 00:00:00 2001 From: alexandre Date: Tue, 22 Nov 2022 14:24:19 +0100 Subject: [PATCH] fix translations --- loopback/locale/en.json | 5 ++++- loopback/locale/es.json | 5 ++++- .../back/methods/receipt/balanceCompensationEmail.js | 10 +++++----- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/loopback/locale/en.json b/loopback/locale/en.json index 887a657a3..2f889ceec 100644 --- a/loopback/locale/en.json +++ b/loopback/locale/en.json @@ -137,5 +137,8 @@ "Claim pickup order sent": "Claim pickup order sent [({{claimId}})]({{{claimUrl}}}) to client *{{clientName}}*", "You don't have grant privilege": "You don't have grant privilege", "You don't own the role and you can't assign it to another user": "You don't own the role and you can't assign it to another user", - "Sale(s) blocked, please contact production": "Sale(s) blocked, please contact production" + "Sale(s) blocked, please contact production": "Sale(s) blocked, please contact production", + "Receipt's bank was not found": "Receipt's bank was not found", + "This receipt was not compensated": "This receipt was not compensated", + "Client's email was not found": "Client's email was not found" } diff --git a/loopback/locale/es.json b/loopback/locale/es.json index b85edb5fe..cb1e2d252 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -243,5 +243,8 @@ "You don't own the role and you can't assign it to another user": "No eres el propietario del rol y no puedes asignarlo a otro usuario", "Already has this status": "Ya tiene este estado", "There aren't records for this week": "No existen registros para esta semana", - "Empty data source": "Origen de datos vacio" + "Empty data source": "Origen de datos vacio", + "Receipt's bank was not found": "No se encontrĂ³ el banco del recibo", + "This receipt was not compensated": "Este recibo no ha sido compensado", + "Client's email was not found": "No se encontrĂ³ el email del cliente" } diff --git a/modules/client/back/methods/receipt/balanceCompensationEmail.js b/modules/client/back/methods/receipt/balanceCompensationEmail.js index f02eeaf74..afae5dabc 100644 --- a/modules/client/back/methods/receipt/balanceCompensationEmail.js +++ b/modules/client/back/methods/receipt/balanceCompensationEmail.js @@ -28,18 +28,18 @@ module.exports = Self => { const models = Self.app.models; const receipt = await models.Receipt.findById(id, {fields: ['clientFk', 'bankFk']}); - const bank = await models.Bank.findById(receipt.bankFk, null); + const bank = await models.Bank.findById(receipt.bankFk); if (!bank) - throw new UserError('Receipt\'s bank was not found'); + throw new UserError(`Receipt's bank was not found`); - const accountingType = await models.AccountingType.findById(bank.accountingTypeFk, null); + const accountingType = await models.AccountingType.findById(bank.accountingTypeFk); if (!(accountingType && accountingType.code == 'compensation')) - throw new UserError('Receipt\'s type was not compensation'); + throw new UserError(`This receipt was not compensated`); const client = await models.Client.findById(receipt.clientFk, {fields: ['email']}); if (!client.email) - throw new UserError('Client\'s email was not found'); + throw new UserError(`Client's email was not found`); else { const email = new Email('balance-compensation', { lang: ctx.req.getLocale(),