231801_test_to_master #1519

Merged
alexm merged 490 commits from 231801_test_to_master into master 2023-05-12 06:29:59 +00:00
3 changed files with 17 additions and 16 deletions
Showing only changes of commit 07148f6c29 - Show all commits

View File

@ -38,7 +38,7 @@ describe('Supplier fiscal data path', () => {
await page.waitToClick(selectors.supplierFiscalData.saveButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
expect(message.text).toContain('Invalid Tax number');
});
it('should save the changes as the tax number is valid this time', async() => {

View File

@ -278,5 +278,6 @@
"Added observation": "{{user}} añadió esta observacion: {{text}}",
"Comment added to client": "Observación añadida al cliente {{clientFk}}",
"Cannot create a new claimBeginning from a different ticket": "No se puede crear una línea de reclamación de un ticket diferente al origen",
"The first two values are letters": "The first two values are letters"
"The first two values are letters": "The first two values are letters",
"NIF no valido por VIES": "NIF no valido por VIES"
}

View File

@ -33,7 +33,7 @@ module.exports = Self => {
});
Self.validateAsync('nif', nifInvalid, {
message: 'Invalid TIN'
message: 'NIF no valido por VIES'
});
Self.validateAsync('nif', tinIsValid, {
@ -61,21 +61,21 @@ module.exports = Self => {
done();
}
// async function tinIsValid(err, done) {
// if (!this.countryFk)
// return done();
async function tinIsValid(err, done) {
if (!this.countryFk)
return 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;
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 (!this.nif || !validateTin(this.nif, code))
// err();
// done();
// }
if (!this.nif || !validateTin(this.nif, code))
err();
done();
}
Self.validateAsync('nif', nifInvalid);
async function nifInvalid(err, done) {