From 417dc511f5fa68b33536b995aca0edaf48fb2c2b Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Wed, 15 May 2019 15:26:13 +0200 Subject: [PATCH] #1430 client.balance bug fix and e2e fix --- e2e/paths/02-client-module/14_risk.spec.js | 9 ++++----- front/core/components/input-number/index.js | 2 +- modules/client/back/methods/receipt/filter.js | 2 +- modules/client/front/balance/index/index.js | 1 + 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/e2e/paths/02-client-module/14_risk.spec.js b/e2e/paths/02-client-module/14_risk.spec.js index 93f68d144..b03f0410a 100644 --- a/e2e/paths/02-client-module/14_risk.spec.js +++ b/e2e/paths/02-client-module/14_risk.spec.js @@ -87,11 +87,11 @@ describe('Client balance path', () => { expect(result).toContain('Data saved!'); }); - it('should check balance is now 100', async() => { + it('should check balance is now -100', async() => { let result = await nightmare .waitToGetProperty(selectors.clientBalance.firstBalanceLine, 'innerText'); - expect(result).toContain('100.00'); + expect(result).toContain('-€100.00'); }); it('should again click the new payment button', async() => { @@ -107,18 +107,17 @@ describe('Client balance path', () => { let result = await nightmare .clearInput(selectors.clientBalance.newPaymentAmountInput) .write(selectors.clientBalance.newPaymentAmountInput, '-150') - .wait(1999) .waitToClick(selectors.clientBalance.saveButton) .waitForLastSnackbar(); expect(result).toContain('Data saved!'); }); - it('should check balance is now -50', async() => { + it('should check balance is now 50', async() => { let result = await nightmare .waitToGetProperty(selectors.clientBalance.firstBalanceLine, 'innerText'); - expect(result).toContain('€50.00'); + expect(result).toContain('50'); }); it('should now click on the Clients button of the top bar menu', async() => { diff --git a/front/core/components/input-number/index.js b/front/core/components/input-number/index.js index 19c28a63d..6c32ebb98 100644 --- a/front/core/components/input-number/index.js +++ b/front/core/components/input-number/index.js @@ -46,7 +46,7 @@ export default class InputNumber extends Input { set value(value) { this.hasValue = !(value === null || value === undefined || value === ''); - if (!this.hasOwnProperty('_value') && this.hasValue) + if (!this.hasOwnProperty('_value') && this.hasValue || value === '') this.input.value = value; this._value = value; diff --git a/modules/client/back/methods/receipt/filter.js b/modules/client/back/methods/receipt/filter.js index 17a8fcadd..768661114 100644 --- a/modules/client/back/methods/receipt/filter.js +++ b/modules/client/back/methods/receipt/filter.js @@ -55,6 +55,7 @@ module.exports = Self => { i.id, TRUE, i.issued, + NULL, c.code, i.created, i.ref, @@ -62,7 +63,6 @@ module.exports = Self => { NULL, NULL, NULL, - NULL, i.clientFk, i.pdf, TRUE isInvoice diff --git a/modules/client/front/balance/index/index.js b/modules/client/front/balance/index/index.js index 2f1676771..5611e9460 100644 --- a/modules/client/front/balance/index/index.js +++ b/modules/client/front/balance/index/index.js @@ -32,6 +32,7 @@ class Controller { setOrder(value) { this.params.params.companyFk = value; this.filter.where.companyFk = value; + this.refresh(); } refresh() {