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 =
|
const salesPersonName =
|
||||||
await page.waitToGetProperty(selectors.clientDefaulter.firstSalesPersonName, 'innerText');
|
await page.waitToGetProperty(selectors.clientDefaulter.firstSalesPersonName, 'innerText');
|
||||||
|
|
||||||
expect(clientName).toEqual('Ororo Munroe');
|
expect(clientName).toEqual('Batman');
|
||||||
expect(salesPersonName).toEqual('salesPersonNick');
|
expect(salesPersonName).toEqual('salesPersonNick');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ module.exports = Self => {
|
||||||
FROM (
|
FROM (
|
||||||
SELECT
|
SELECT
|
||||||
DISTINCT c.id clientFk,
|
DISTINCT c.id clientFk,
|
||||||
c.name clientName,
|
c.socialName clientName,
|
||||||
c.salesPersonFk,
|
c.salesPersonFk,
|
||||||
u.nickname salesPersonName,
|
u.nickname salesPersonName,
|
||||||
d.amount,
|
d.amount,
|
||||||
|
|
|
@ -47,12 +47,12 @@ describe('defaulter filter()', () => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const options = {transaction: tx};
|
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 result = await models.Defaulter.filter(ctx, null, options);
|
||||||
const firstRow = result[0];
|
const firstRow = result[0];
|
||||||
|
|
||||||
expect(firstRow.clientName).toEqual('Bruce Wayne');
|
expect(firstRow.clientName).toEqual('Spider man');
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -16,8 +16,8 @@ export default class Controller extends Section {
|
||||||
field: 'clientName',
|
field: 'clientName',
|
||||||
autocomplete: {
|
autocomplete: {
|
||||||
url: 'Clients',
|
url: 'Clients',
|
||||||
showField: 'name',
|
showField: 'socialName',
|
||||||
valueField: 'name'
|
valueField: 'socialName'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -30,15 +30,10 @@ export default class Controller extends Section {
|
||||||
valueField: 'id',
|
valueField: 'id',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
field: 'amount',
|
|
||||||
searchable: false
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
field: 'workerFk',
|
field: 'workerFk',
|
||||||
autocomplete: {
|
autocomplete: {
|
||||||
url: 'Workers/activeWithInheritedRole',
|
url: 'Workers/activeWithInheritedRole',
|
||||||
where: `{role: 'salesPerson'}`,
|
|
||||||
searchFunction: '{firstName: $search}',
|
searchFunction: '{firstName: $search}',
|
||||||
showField: 'nickname',
|
showField: 'nickname',
|
||||||
valueField: 'id',
|
valueField: 'id',
|
||||||
|
@ -53,7 +48,7 @@ export default class Controller extends Section {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'creditInsurance',
|
field: 'created',
|
||||||
searchable: false
|
searchable: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -122,7 +117,9 @@ export default class Controller extends Section {
|
||||||
exprBuilder(param, value) {
|
exprBuilder(param, value) {
|
||||||
switch (param) {
|
switch (param) {
|
||||||
case 'observation':
|
case 'observation':
|
||||||
return {[`observation`]: value};
|
return {[`observation`]: {like: `%${value}%`}};
|
||||||
|
case 'creditInsurance':
|
||||||
|
case 'amount':
|
||||||
case 'clientName':
|
case 'clientName':
|
||||||
case 'workerFk':
|
case 'workerFk':
|
||||||
case 'salesPersonFk':
|
case 'salesPersonFk':
|
||||||
|
|
Loading…
Reference in New Issue