corregida logica al añadir credito

This commit is contained in:
Daniel Herrero 2017-11-29 11:12:28 +01:00
parent 261d9408ee
commit c217e5c27f
2 changed files with 4 additions and 6 deletions

View File

@ -116,12 +116,7 @@ module.exports = function(Client) {
}
function maxCb(_, instances) {
if (!instances) {
done(generateErrorCredit());
return;
}
if (instances.length !== 1 || instances[0].employeeFk == userId || instances[0].amount > 0) {
if (!instances || instances.length !== 1 || instances[0].employeeFk == userId || instances[0].amount > 0) {
done();
return;
}

View File

@ -1,4 +1,7 @@
module.exports = fi => {
if (fi === undefined || fi === null) {
return true;
}
let dni = fi;
let getLetterDni = dni => {
const regExpDni = 'TRWAGMYFPDXBNJZSQVHLCKE';