Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/pipeline/head Build queued... Details

This commit is contained in:
Javi Gallego 2023-03-08 07:45:25 +01:00
commit bb691ccf1d
5 changed files with 40 additions and 36 deletions

View File

@ -29,19 +29,19 @@ module.exports = Self => {
myOptions.transaction = ctx.options.transaction;
const claimBeginning = await Self.findById(ctx.where.id);
const filter = {
where: {id: claimBeginning.claimFk},
include: [
{
relation: 'claimState',
scope: {
fields: ['id', 'code', 'description']
}
}
]
};
where: {id: claimBeginning.claimFk},
include: [
{
relation: 'claimState',
scope: {
fields: ['id', 'code', 'description']
}
}
]
};
const [claim] = await models.Claim.find(filter, myOptions);
const isEditable = await models.ClaimState.isEditable(httpCtx, claim.claimState().id);

View File

@ -100,8 +100,8 @@ class Controller extends Section {
}
setClaimedQuantity(id, claimedQuantity) {
let params = {id: id, quantity: claimedQuantity};
let query = `ClaimBeginnings/`;
let params = {quantity: claimedQuantity};
let query = `ClaimBeginnings/${id}`;
this.$http.patch(query, params).then(() => {
this.vnApp.showSuccess(this.$t('Data saved!'));
this.calculateTotals();

View File

@ -13,55 +13,59 @@ module.exports = Self => {
type: 'Object',
description: 'Filter defining where, order, offset, and limit - must be a JSON-encoded string',
http: {source: 'query'}
}, {
arg: 'tags',
type: ['Object'],
description: 'List of tags to filter with',
http: {source: 'query'}
}, {
},
{
arg: 'search',
type: 'String',
description: `If it's and integer searchs by id, otherwise it searchs by name`,
http: {source: 'query'}
}, {
},
{
arg: 'id',
type: 'Integer',
description: 'The worker id',
http: {source: 'query'}
}, {
},
{
arg: 'userFk',
type: 'Integer',
description: 'The user id',
http: {source: 'query'}
}, {
},
{
arg: 'fi',
type: 'String',
description: 'The worker fi',
http: {source: 'query'}
}, {
},
{
arg: 'departmentFk',
type: 'Integer',
description: 'The worker department id',
http: {source: 'query'}
}, {
},
{
arg: 'extension',
type: 'Integer',
description: 'The worker extension id',
http: {source: 'query'}
}, {
},
{
arg: 'firstName',
type: 'String',
description: 'The worker firstName',
http: {source: 'query'}
}, {
arg: 'name',
},
{
arg: 'lastName',
type: 'String',
description: 'The worker name',
description: 'The worker lastName',
http: {source: 'query'}
}, {
arg: 'nickname',
},
{
arg: 'userName',
type: 'String',
description: 'The worker nickname',
description: 'The worker user name',
http: {source: 'query'}
}
],
@ -93,10 +97,10 @@ module.exports = Self => {
return {'w.id': value};
case 'userFk':
return {'w.userFk': value};
case 'name':
return {'w.lastName': {like: `%${value}%`}};
case 'firstName':
return {'w.firstName': {like: `%${value}%`}};
case 'lastName':
return {'w.lastName': {like: `%${value}%`}};
case 'extension':
return {'p.extension': value};
case 'fi':

View File

@ -16,7 +16,7 @@ describe('worker filter()', () => {
});
it('should return 2 results filtering by name', async() => {
let result = await app.models.Worker.filter({args: {filter: {}, name: 'agency'}});
let result = await app.models.Worker.filter({args: {filter: {}, firstName: 'agency'}});
expect(result.length).toEqual(2);
expect(result[0].nickname).toEqual('agencyNick');

View File

@ -30,7 +30,7 @@
<vn-textfield
vn-one
label="Last name"
ng-model="filter.name">
ng-model="filter.lastName">
</vn-textfield>
</vn-horizontal>
<vn-horizontal>