feat: refs #7187 Add support for multiple PDAs per user #2496

Merged
pablone merged 2 commits from 7187-add-traducctions into test 2024-05-23 10:24:54 +00:00
3 changed files with 8 additions and 3 deletions

View File

@ -226,5 +226,6 @@
"This password can only be changed by the user themselves": "This password can only be changed by the user themselves", "This password can only be changed by the user themselves": "This password can only be changed by the user themselves",
"They're not your subordinate": "They're not your subordinate", "They're not your subordinate": "They're not your subordinate",
"InvoiceIn is already booked": "InvoiceIn is already booked", "InvoiceIn is already booked": "InvoiceIn is already booked",
"This workCenter is already assigned to this agency": "This workCenter is already assigned to this agency" "This workCenter is already assigned to this agency": "This workCenter is already assigned to this agency",
"You can only have one PDA": "You can only have one PDA"
} }

View File

@ -357,6 +357,7 @@
"This workCenter is already assigned to this agency": "Este centro de trabajo ya está asignado a esta agencia", "This workCenter is already assigned to this agency": "Este centro de trabajo ya está asignado a esta agencia",
"Select ticket or client": "Elija un ticket o un client", "Select ticket or client": "Elija un ticket o un client",
"It was not able to create the invoice": "No se pudo crear la factura", "It was not able to create the invoice": "No se pudo crear la factura",
"This PDA is already assigned to another user": "This PDA is already assigned to another user", "ticketCommercial": "El ticket {{ ticket }} para el vendedor {{ salesMan }} está en preparación. (mensaje generado automáticamente)",
"ticketCommercial": "El ticket {{ ticket }} para el vendedor {{ salesMan }} está en preparación. (mensaje generado automáticamente)" "This PDA is already assigned to another user": "Este PDA ya está asignado a otro usuario",
"You can only have one PDA": "Solo puedes tener un PDA"
} }

View File

@ -3,6 +3,9 @@ module.exports = Self => {
Self.rewriteDbError(function(err) { Self.rewriteDbError(function(err) {
if (err.code === 'ER_DUP_ENTRY') if (err.code === 'ER_DUP_ENTRY')
return new UserError(`This PDA is already assigned to another user`); return new UserError(`This PDA is already assigned to another user`);
if (err.code === 'ER_SIGNAL_EXCEPTION' && err.sqlMessage === 'You can only have one active PDA')
return new UserError(err.sqlMessage);
pablone marked this conversation as resolved Outdated
Outdated
Review

Tb se podria haver fet return new UserError(err.sqlMessage) per no repetir

Tb se podria haver fet `return new UserError(err.sqlMessage)` per no repetir
return err; return err;
}); });
}; };