This commit is contained in:
parent
c4ff4c1984
commit
c77715d865
|
@ -3014,7 +3014,7 @@ UPDATE `vn`.`client`
|
||||||
SET fi='65004204V'
|
SET fi='65004204V'
|
||||||
WHERE id=1;
|
WHERE id=1;
|
||||||
|
|
||||||
UPDATE `vn`.`client`
|
UPDATE `vn`.`worker`
|
||||||
SET fi='59328808D'
|
SET fi='59328808D'
|
||||||
WHERE id=1106;
|
WHERE id=1106;
|
||||||
|
|
||||||
|
|
|
@ -34,17 +34,12 @@ module.exports = Self => {
|
||||||
fields: ['code'],
|
fields: ['code'],
|
||||||
where: {id: this.countryFk}
|
where: {id: this.countryFk}
|
||||||
};
|
};
|
||||||
|
|
||||||
const country = await Self.app.models.Country.findOne(filter);
|
const country = await Self.app.models.Country.findOne(filter);
|
||||||
const code = country ? country.code.toLowerCase() : null;
|
const code = country ? country.code.toLowerCase() : null;
|
||||||
const client = (await Self.findById(this.id, {
|
const countryCode = this.fi?.toLowerCase().substring(0, 2);
|
||||||
include: {relation: 'client'}}))?.client();
|
|
||||||
if (client) {
|
|
||||||
const countryCode = client.fi?.toLowerCase().substring(0, 2);
|
|
||||||
|
|
||||||
if (!client.fi || !validateTin(client.fi, code) || countryCode == code)
|
if (!this.fi || !validateTin(this.fi, code) || countryCode == code)
|
||||||
err();
|
err();
|
||||||
}
|
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue