diff --git a/modules/client/front/billing-data/index.html b/modules/client/front/billing-data/index.html index b9c20ec24c..ae1ad85a5d 100644 --- a/modules/client/front/billing-data/index.html +++ b/modules/client/front/billing-data/index.html @@ -108,53 +108,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + \ No newline at end of file diff --git a/modules/client/front/billing-data/index.js b/modules/client/front/billing-data/index.js index 2dda347b9d..dd43a661e0 100644 --- a/modules/client/front/billing-data/index.js +++ b/modules/client/front/billing-data/index.js @@ -42,12 +42,11 @@ export default class Controller extends Section { this.newBankEntity = { countryFk: Number.parseInt(this.client.countryFk) }; - this.$.bankEntityDialog.show(); + this.$.bankEntity.open(); } - onBankEntityAccept() { - return this.$http.post(`BankEntities`, this.newBankEntity) - .then(res => this.client.bankEntityFk = res.data.id); + onResponse(response) { + this.client.bankEntityFk = response.id; } get ibanCountry() { diff --git a/modules/client/front/billing-data/index.spec.js b/modules/client/front/billing-data/index.spec.js index 95700cb5ac..60cc4025c4 100644 --- a/modules/client/front/billing-data/index.spec.js +++ b/modules/client/front/billing-data/index.spec.js @@ -35,20 +35,12 @@ describe('Client', () => { }); }); - describe('onBankEntityAccept()', () => { - it('should request to create a new bank entity', () => { - let newBankEntity = { - name: 'My new bank entity', - bic: 'ES123', - countryFk: 1, - id: 999 - }; - controller.newBankEntity = newBankEntity; - $httpBackend.expectPOST('BankEntities', newBankEntity).respond({id: 999}); - controller.onBankEntityAccept(); - $httpBackend.flush(); + describe('onResponse()', () => { + it('should assign the response id to the client bankEntityFk', () => { + const expectedResponse = {id: 999}; + controller.onResponse(expectedResponse); - expect(controller.client.bankEntityFk).toEqual(newBankEntity.id); + expect(controller.client.bankEntityFk).toEqual(expectedResponse.id); }); }); diff --git a/modules/client/front/billing-data/locale/es.yml b/modules/client/front/billing-data/locale/es.yml index a7ecbbdae8..0052ee4039 100644 --- a/modules/client/front/billing-data/locale/es.yml +++ b/modules/client/front/billing-data/locale/es.yml @@ -14,5 +14,4 @@ Received core VNL: Recibido core VNL Received B2B VNL: Recibido B2B VNL Save: Guardar New bank entity: Nueva entidad bancaria -Name can't be empty: El nombre no puede quedar vacío -Entity Code: Código \ No newline at end of file +Name can't be empty: El nombre no puede quedar vacío \ No newline at end of file diff --git a/modules/supplier/front/account/index.html b/modules/supplier/front/account/index.html index 7264f6f2c7..c8ec8ba31c 100644 --- a/modules/supplier/front/account/index.html +++ b/modules/supplier/front/account/index.html @@ -65,6 +65,7 @@ + { expect(controller.$.bankEntity.open).toHaveBeenCalledWith(); }); - it('should request to create a new bank entity', () => { + it('should now request to create a new bank entity', () => { controller.bankEntity = { name: 'My new bank entity', bic: 'ES1234',