Errores validacion solucionados
This commit is contained in:
parent
0f4ac0edbb
commit
daaf73a143
|
@ -37,13 +37,6 @@ module.exports = function(Client) {
|
||||||
max: 23
|
max: 23
|
||||||
});
|
});
|
||||||
|
|
||||||
Client.validate('payMethod', hasCC, {
|
|
||||||
message: 'El método de pago seleccionado requiere que se especifique IBAN del cliente'
|
|
||||||
});
|
|
||||||
function hasCC(err) {
|
|
||||||
if (this.payMethod == 2 && !this.iban) err();
|
|
||||||
};
|
|
||||||
|
|
||||||
Client.validate('payMethod', hasSalesMan, {
|
Client.validate('payMethod', hasSalesMan, {
|
||||||
message: 'No se puede cambiar la forma de pago si no hay comercial asignado'
|
message: 'No se puede cambiar la forma de pago si no hay comercial asignado'
|
||||||
});
|
});
|
||||||
|
@ -52,7 +45,7 @@ module.exports = function(Client) {
|
||||||
};
|
};
|
||||||
|
|
||||||
Client.validateAsync('payMethodFk', hasIban, {
|
Client.validateAsync('payMethodFk', hasIban, {
|
||||||
message: 'Tiene que rellenar el IBAN'
|
message: 'El método de pago seleccionado requiere que se especifique el IBAN'
|
||||||
});
|
});
|
||||||
function hasIban(err, done) {
|
function hasIban(err, done) {
|
||||||
let iban = this.iban;
|
let iban = this.iban;
|
||||||
|
|
Loading…
Reference in New Issue