Added filter for selection
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
jorgebl 2021-02-22 16:43:40 +01:00
parent 5ef48919ec
commit 69f53972d5
2 changed files with 47 additions and 3 deletions

View File

@ -44,6 +44,10 @@ module.exports = Self => {
arg: 'description',
type: 'String',
description: 'The item description',
}, {
arg: 'stemMultiplier',
type: 'Integer',
description: 'The item multiplier',
}
],
returns: {
@ -82,14 +86,22 @@ module.exports = Self => {
return {'i.id': value};
case 'description':
return {'i.description': {like: `%${value}%`}};
case 'categoryFk':
return {'ic.id': value};
case 'category':
return {'ic.name': value};
case 'salesPersonFk':
return {'t.workerFk': value};
case 'typeFk':
case 'type':
return {'i.typeFk': value};
case 'isActive':
return {'i.isActive': value};
case 'multiplier':
return {'i.stemMultiplier': value};
case 'origin':
return {'ori.code': value};
case 'niche':
return {'itn.code': value};
case 'intrastat':
return {'intr.description': value};
}
});
filter = mergeFilters(filter, {where});
@ -112,6 +124,7 @@ module.exports = Self => {
i.subName,
i.isActive,
t.name type,
i.typeFk as type,
t.workerFk buyerFk,
u.name userName,
intr.description AS intrastat,

View File

@ -11,6 +11,37 @@ class Controller extends Section {
};
}
exprBuilder(param, value) {
switch (param) {
case 'category':
return {'ic.name': value};
case 'salesPersonFk':
return {'t.workerFk': value};
case 'grouping':
return {'b.grouping': value};
case 'packing':
return {'b.packing': value};
case 'origin':
return {'ori.code': value};
case 'niche':
return {'itn.code': value};
case 'type':
return {'i.typeFk': value};
case 'intrastat':
return {'intr.description': value};
case 'id':
case 'description':
case 'size':
case 'name':
case 'subname':
case 'isActive':
case 'density':
case 'stemMultiplier':
case 'stems':
return {[`i.${param}`]: value};
}
}
onCloneAccept(itemFk) {
return this.$http.post(`Items/${itemFk}/clone`)
.then(res => {