hotfix fix createWorker business #2725
|
@ -53,7 +53,7 @@
|
||||||
<vn-autocomplete vn-one
|
<vn-autocomplete vn-one
|
||||||
ng-model="$ctrl.location.countryFk"
|
ng-model="$ctrl.location.countryFk"
|
||||||
url="Countries"
|
url="Countries"
|
||||||
show-field="country"
|
show-field="name"
|
||||||
value-field="id"
|
value-field="id"
|
||||||
label="Country">
|
label="Country">
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
|
|
|
@ -202,7 +202,7 @@ module.exports = Self => {
|
||||||
bossFk,
|
bossFk,
|
||||||
fi,
|
fi,
|
||||||
birth,
|
birth,
|
||||||
|
provinceFk,
|
||||||
|
|||||||
}, myOptions);
|
}, myOptions);
|
||||||
|
|
||||||
if (tx) await tx.commit();
|
if (tx) await tx.commit();
|
||||||
|
|
|
@ -27,13 +27,17 @@ module.exports = Self => {
|
||||||
});
|
});
|
||||||
|
|
||||||
async function tinIsValid(err, done) {
|
async function tinIsValid(err, done) {
|
||||||
|
const countryFk = {
|
||||||
alexm
commented
Este enfoque no lo acabo de ver, se deberia sacar del originCountryFk Este enfoque no lo acabo de ver, se deberia sacar del originCountryFk
|
|||||||
|
fields: ['countryFk'],
|
||||||
|
where: {id: this.provinceFk}
|
||||||
|
};
|
||||||
|
const countryCode = await Self.app.models.Province.findOne(countryFk);
|
||||||
const filter = {
|
const filter = {
|
||||||
fields: ['code'],
|
fields: ['code'],
|
||||||
where: {id: this.countryFk}
|
where: {id: countryCode.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;
|
||||||
|
|
||||||
if (!this.fi || !validateTin(this.fi, code))
|
if (!this.fi || !validateTin(this.fi, code))
|
||||||
err();
|
err();
|
||||||
done();
|
done();
|
||||||
|
|
Loading…
Reference in New Issue
Worker no tiene el campo provinceFk ni countryFk, el unico que tiene es originCountryFk