Merge pull request 'fix: autocompletar el switf/bic' (!1388) from 5352-worker.create_swift/bic into dev
gitea/salix/pipeline/head Build queued... Details

Reviewed-on: #1388
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
Reviewed-by: Joan Sanchez <joan@verdnatura.es>
This commit is contained in:
Joan Sanchez 2023-03-16 06:25:18 +00:00
commit d9296c139d
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];