Merge pull request '#5834 - billingDataAutoFillBic' (!1821) from 5834-billingDataAutoFillBic into dev
gitea/salix/pipeline/head There was a failure building this commit Details

Reviewed-on: #1821
This commit is contained in:
Javier Segarra 2024-02-06 16:36:35 +00:00
commit a8a5ddd889
3 changed files with 23 additions and 1 deletions

View File

@ -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();
}
};

View File

@ -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",

View File

@ -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"
}