231801_test_to_master #1519

Merged
alexm merged 490 commits from 231801_test_to_master into master 2023-05-12 06:29:59 +00:00
2 changed files with 7 additions and 9 deletions
Showing only changes of commit 60103fa80a - Show all commits

View File

@ -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"
}

View File

@ -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) {