From 497d756af615446ddfe8a9a2db8bddfc981507b6 Mon Sep 17 00:00:00 2001 From: vicent Date: Fri, 3 Mar 2023 13:46:18 +0100 Subject: [PATCH] fix: autocompletar el switf/bic --- modules/worker/front/create/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/worker/front/create/index.js b/modules/worker/front/create/index.js index 7e837fe02..7966926b0 100644 --- a/modules/worker/front/create/index.js +++ b/modules/worker/front/create/index.js @@ -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];