231801_test_to_master #1519
|
@ -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() => {
|
||||
|
|
|
@ -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"
|
||||
}
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue