Bug fixeds and merge with test

This commit is contained in:
Daniel Herrero 2018-02-15 14:37:54 +01:00
commit 6fe1f96ef3
5 changed files with 19 additions and 15 deletions

12
Jenkinsfile vendored
View File

@ -43,18 +43,12 @@ node
stage ("Stopping/Removing Docker")
{
step{
env.TAG = env.BUILD_NUMBER - 1;
sh "docker-compose down --rmi 'all'"
}
sh "docker-compose down --rmi 'all'"
}
stage ("Generar dockers")
{
step{
env.TAG = env.BUILD_NUMBER + 1;
sh "docker-compose up -d --build"
}
sh "docker-compose up -d --build"
}
}
}
}

View File

@ -136,10 +136,8 @@
"menu": {
"description": "Credit",
"icon": "credit_card"
},
"acl": ["manager", "salesAssistant", "teamBoss", "teamManager"]
},
{
}
}, {
"url": "/create",
"state": "clientCard.credit.create",
"component": "vn-client-credit-create",

View File

@ -30,7 +30,7 @@ module.exports = Client => {
FROM worker em
JOIN account.user ac ON em.userFk = ac.id
JOIN account.role r ON r.id = ac.role
WHERE ac.active AND r.\`name\` = 'salesPerson' ${where.sql}
WHERE ac.active ${where.sql}
ORDER BY em.name ASC
LIMIT ? OFFSET ?`;

View File

@ -1,7 +1,16 @@
const md5 = require('md5');
module.exports = function(Self) {
// Validations
Self.validatesUniquenessOf('name', {
message: 'Ya existe un usuario con ese nombre'
});
Self.observe('before save', (ctx, next) => {
if (ctx.currentInstance && ctx.currentInstance.id && ctx.data && ctx.data.password) {
ctx.data.password = md5(ctx.data.password);
}
next();
});
};

View File

@ -69,6 +69,9 @@ module.exports = fi => {
const dniLetterAscii = parseInt(dniLetterCountry.charCodeAt(0));
let dniValue = false;
switch (true) {
case (dni.length === 9 && !isNaN(dni)): // dni Portugal (9 digitos)
dniValue = true;
break;
case (dniLetterAscii >= 88 && dniLetterAscii <= 90): // X-Z
dniValue = getDniForeign(dniNumeric, dniLetter);
break;
@ -81,7 +84,7 @@ module.exports = fi => {
case (dniLetterAscii === 73): // I
dniValue = getDniItaly(dniLetterCountry);
break;
case (dniLetterAscii >= 48 && dniLetterAscii <= 57): // 0- 9
case (dni.length === 9 && dniLetterAscii >= 48 && dniLetterAscii <= 57): // 0- 9
dniValue = getDniSpain(dniNumeric, dniLetter);
break;
default: