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) { function maxCb(_, instances) {
if (!instances) { if (!instances || instances.length !== 1 || instances[0].employeeFk == userId || instances[0].amount > 0) {
done(generateErrorCredit());
return;
}
if (instances.length !== 1 || instances[0].employeeFk == userId || instances[0].amount > 0) {
done(); done();
return; return;
} }

View File

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