This commit is contained in:
parent
117849f093
commit
60103fa80a
|
@ -274,5 +274,6 @@
|
|||
"This ticket cannot be signed because it has not been boxed": "Este ticket no puede firmarse porque no ha sido encajado",
|
||||
"Insert a date range": "Inserte un rango de fechas",
|
||||
"Added observation": "{{user}} añadió esta observacion: {{text}}",
|
||||
"Comment added to client": "Observación añadida al cliente {{clientFk}}"
|
||||
"Comment added to client": "Observación añadida al cliente {{clientFk}}",
|
||||
"The first two values are letters": "Los dos primeros carácteres del NIF son letras"
|
||||
}
|
||||
|
|
|
@ -73,16 +73,13 @@ module.exports = Self => {
|
|||
done();
|
||||
}
|
||||
|
||||
Self.validateAsync('nif', areFirstTwoCharsLetters, nifInvalid, {
|
||||
message: 'The first two values are letters.'});
|
||||
Self.validateAsync('nif', nifInvalid, {
|
||||
message: 'The first two values are letters'});
|
||||
|
||||
function areFirstTwoCharsLetters(str) {
|
||||
return /^[a-zA-Z]{2}/.test(str);
|
||||
}
|
||||
|
||||
async function nifInvalid(err, areFirstTwoCharsLetters) {
|
||||
if (this.isVies == 1 && areFirstTwoCharsLetters(this.nif))
|
||||
async function nifInvalid(err, done) {
|
||||
if (this.isVies && /^[a-zA-Z]{2}/.test(this.nif))
|
||||
err();
|
||||
done();
|
||||
}
|
||||
|
||||
function isAlpha(value) {
|
||||
|
|
Loading…
Reference in New Issue