#5834 - billingDataAutoFillBic #1821
|
@ -8,6 +8,26 @@ module.exports = Self => {
|
|||
});
|
||||
|
||||
Self.validatesUniquenessOf('bic', {
|
||||
message: 'This BIC already exist.'
|
||||
message: 'This BIC already exist'
|
||||
});
|
||||
|
||||
Self.validatesPresenceOf('countryFk', {
|
||||
message: 'CountryFK cannot be empty'
|
||||
});
|
||||
|
||||
Self.validateAsync('bic', checkBic, {
|
||||
message: 'Bank entity id must be specified'
|
||||
});
|
||||
async function checkBic(err, done) {
|
||||
const filter = {
|
||||
fields: ['code'],
|
||||
where: {id: this.countryFk}
|
||||
};
|
||||
const country = await Self.app.models.Country.findOne(filter);
|
||||
const code = country ? country.code.toLowerCase() : null;
|
||||
|
||||
if (code == 'es' && !this.id)
|
||||
err();
|
||||
done();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -198,6 +198,7 @@
|
|||
"Booking completed": "Booking complete",
|
||||
"The ticket is in preparation": "The ticket [{{ticketId}}]({{{ticketUrl}}}) of the sales person {{salesPersonId}} is in preparation",
|
||||
"You can only add negative amounts in refund tickets": "You can only add negative amounts in refund tickets",
|
||||
"Bank entity must be specified": "Bank entity must be specified",
|
||||
"Try again": "Try again",
|
||||
"keepPrice": "keepPrice",
|
||||
"Cannot past travels with entries": "Cannot past travels with entries",
|
||||
|
|
|
@ -338,5 +338,6 @@
|
|||
"The alias cant be modified": "Este alias de correo no puede ser modificado",
|
||||
"No tickets to invoice": "No hay tickets para facturar",
|
||||
"Name should be uppercase": "El nombre debe ir en mayúscula",
|
||||
"Bank entity must be specified": "La entidad bancaria es obligatoria",
|
||||
"An email is necessary": "Es necesario un email"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue