diff --git a/e2e/paths/02-client/21_defaulter.spec.js b/e2e/paths/02-client/21_defaulter.spec.js index 1066776d6..3630a958a 100644 --- a/e2e/paths/02-client/21_defaulter.spec.js +++ b/e2e/paths/02-client/21_defaulter.spec.js @@ -28,7 +28,7 @@ describe('Client defaulter path', () => { const salesPersonName = await page.waitToGetProperty(selectors.clientDefaulter.firstSalesPersonName, 'innerText'); - expect(clientName).toEqual('Ororo Munroe'); + expect(clientName).toEqual('Batman'); expect(salesPersonName).toEqual('salesPersonNick'); }); diff --git a/modules/client/back/methods/defaulter/filter.js b/modules/client/back/methods/defaulter/filter.js index 0a1d5093b..c65991273 100644 --- a/modules/client/back/methods/defaulter/filter.js +++ b/modules/client/back/methods/defaulter/filter.js @@ -56,7 +56,7 @@ module.exports = Self => { FROM ( SELECT DISTINCT c.id clientFk, - c.name clientName, + c.socialName clientName, c.salesPersonFk, u.nickname salesPersonName, d.amount, diff --git a/modules/client/back/methods/defaulter/specs/filter.spec.js b/modules/client/back/methods/defaulter/specs/filter.spec.js index 145bb5132..ca14d1e43 100644 --- a/modules/client/back/methods/defaulter/specs/filter.spec.js +++ b/modules/client/back/methods/defaulter/specs/filter.spec.js @@ -47,12 +47,12 @@ describe('defaulter filter()', () => { try { const options = {transaction: tx}; - const ctx = {req: {accessToken: {userId: authUserId}}, args: {search: 'bruce'}}; + const ctx = {req: {accessToken: {userId: authUserId}}, args: {search: 'spider'}}; const result = await models.Defaulter.filter(ctx, null, options); const firstRow = result[0]; - expect(firstRow.clientName).toEqual('Bruce Wayne'); + expect(firstRow.clientName).toEqual('Spider man'); await tx.rollback(); } catch (e) { diff --git a/modules/client/front/defaulter/index.js b/modules/client/front/defaulter/index.js index f4071108c..5fcc955cc 100644 --- a/modules/client/front/defaulter/index.js +++ b/modules/client/front/defaulter/index.js @@ -16,8 +16,8 @@ export default class Controller extends Section { field: 'clientName', autocomplete: { url: 'Clients', - showField: 'name', - valueField: 'name' + showField: 'socialName', + valueField: 'socialName' } }, { @@ -34,7 +34,6 @@ export default class Controller extends Section { field: 'workerFk', autocomplete: { url: 'Workers/activeWithInheritedRole', - where: `{role: 'salesPerson'}`, searchFunction: '{firstName: $search}', showField: 'nickname', valueField: 'id', @@ -48,6 +47,10 @@ export default class Controller extends Section { valueField: 'observation', } }, + { + field: 'created', + searchable: false + }, { field: 'defaulterSinced', searchable: false