fix: autocompletar el switf/bic
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2023-03-03 13:46:18 +01:00
parent d836874b7c
commit 497d756af6
1 changed files with 8 additions and 2 deletions

View File

@ -13,14 +13,20 @@ export default class Controller extends Section {
});
}
get ibanCountry() {
if (!this.worker || !this.worker.iban) return false;
let countryCode = this.worker.iban.substr(0, 2);
return countryCode;
}
autofillBic() {
if (!this.worker || !this.worker.iban) return;
let bankEntityId = parseInt(this.worker.iban.substr(4, 4));
let filter = {where: {id: bankEntityId}};
if (this.ibanCountry != 'ES') return;
this.$http.get(`BankEntities`, {filter}).then(response => {
const hasData = response.data && response.data[0];