Merge branch '3622-client_defaulter' of https://gitea.verdnatura.es/verdnatura/salix into 3622-client_defaulter
This commit is contained in:
commit
5a906d075a
|
@ -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');
|
||||
});
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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':
|
||||
|
|
Loading…
Reference in New Issue