fix translations

This commit is contained in:
Alexandre Riera 2022-11-22 14:24:19 +01:00
parent 40ea9805cf
commit 34fb80beec
3 changed files with 13 additions and 7 deletions

View File

@ -137,5 +137,8 @@
"Claim pickup order sent": "Claim pickup order sent [({{claimId}})]({{{claimUrl}}}) to client *{{clientName}}*", "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 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", "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"
} }

View File

@ -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", "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", "Already has this status": "Ya tiene este estado",
"There aren't records for this week": "No existen registros para esta semana", "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"
} }

View File

@ -28,18 +28,18 @@ module.exports = Self => {
const models = Self.app.models; const models = Self.app.models;
const receipt = await models.Receipt.findById(id, {fields: ['clientFk', 'bankFk']}); 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) 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')) 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']}); const client = await models.Client.findById(receipt.clientFk, {fields: ['email']});
if (!client.email) if (!client.email)
throw new UserError('Client\'s email was not found'); throw new UserError(`Client's email was not found`);
else { else {
const email = new Email('balance-compensation', { const email = new Email('balance-compensation', {
lang: ctx.req.getLocale(), lang: ctx.req.getLocale(),