Merge branch '3622-client_defaulter' of https://gitea.verdnatura.es/verdnatura/salix into 3622-client_defaulter

This commit is contained in:
Alex Moreno 2022-03-01 11:39:20 +01:00
commit 5a906d075a
4 changed files with 10 additions and 13 deletions

View File

@ -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');
});

View File

@ -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,

View File

@ -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) {

View File

@ -16,8 +16,8 @@ export default class Controller extends Section {
field: 'clientName',
autocomplete: {
url: 'Clients',
showField: 'name',
valueField: 'name'
showField: 'socialName',
valueField: 'socialName'
}
},
{
@ -30,15 +30,10 @@ export default class Controller extends Section {
valueField: 'id',
}
},
{
field: 'amount',
searchable: false
},
{
field: 'workerFk',
autocomplete: {
url: 'Workers/activeWithInheritedRole',
where: `{role: 'salesPerson'}`,
searchFunction: '{firstName: $search}',
showField: 'nickname',
valueField: 'id',
@ -53,7 +48,7 @@ export default class Controller extends Section {
}
},
{
field: 'creditInsurance',
field: 'created',
searchable: false
},
{
@ -122,7 +117,9 @@ export default class Controller extends Section {
exprBuilder(param, value) {
switch (param) {
case 'observation':
return {[`observation`]: value};
return {[`observation`]: {like: `%${value}%`}};
case 'creditInsurance':
case 'amount':
case 'clientName':
case 'workerFk':
case 'salesPersonFk':