3389-item and entry/latest-buys search-panels add filter supplier #796

Merged
carlosjr merged 5 commits from 3332-item_search-panel into dev 2021-11-22 15:34:41 +00:00
4 changed files with 43 additions and 3 deletions
Showing only changes of commit d2729e67e9 - Show all commits

View File

@ -39,6 +39,11 @@ module.exports = Self => {
type: 'integer',
description: 'The buyer of the item',
},
{
arg: 'supplierFk',
type: 'integer',
description: 'The supplier of the item',
},
{
arg: 'active',
type: 'boolean',
@ -99,6 +104,8 @@ module.exports = Self => {
return {'ic.id': value};
case 'salesPersonFk':
return {'it.workerFk': value};
case 'supplierFk':
return {'s.id': value};
case 'code':
return {'it.code': value};
case 'active':
@ -172,7 +179,9 @@ module.exports = Self => {
LEFT JOIN itemCategory ic ON ic.id = it.categoryFk
LEFT JOIN itemType t ON t.id = i.typeFk
LEFT JOIN intrastat intr ON intr.id = i.intrastatFk
LEFT JOIN origin ori ON ori.id = i.originFk`
LEFT JOIN origin ori ON ori.id = i.originFk
LEFT JOIN entry e ON e.id = b.entryFk
LEFT JOIN supplier s ON s.id = e.supplierFk`
);
if (ctx.args.tags) {

View File

@ -46,6 +46,17 @@
where="{role: {inq: ['logistic', 'buyer']}}"
label="Buyer">
</vn-autocomplete>
<vn-autocomplete
vn-one
label="Supplier"
ng-model="filter.supplierFk"
url="Suppliers"
fields="['name','nickname']"
search-function="{or: [{nickname: {like: '%'+ $search +'%'}}, {name: {like: '%'+ $search +'%'}}]}"
show-field="name"
value-field="id">
<tpl-item>{{name}}: {{nickname}}</tpl-item>
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-check

View File

@ -48,6 +48,11 @@ module.exports = Self => {
type: 'integer',
description: 'The buyer of the item',
},
{
arg: 'supplierFk',
type: 'integer',
description: 'The supplier of the item',
},
{
arg: 'description',
type: 'string',
@ -120,6 +125,8 @@ module.exports = Self => {
return {'ic.id': value};
case 'buyerFk':
return {'it.workerFk': value};
case 'supplierFk':
return {'s.id': value};
case 'origin':
return {'ori.code': value};
case 'intrastat':
@ -170,7 +177,9 @@ module.exports = Self => {
LEFT JOIN producer pr ON pr.id = i.producerFk
LEFT JOIN origin ori ON ori.id = i.originFk
LEFT JOIN cache.last_buy lb ON lb.item_id = i.id AND lb.warehouse_id = it.warehouseFk
LEFT JOIN vn.buy b ON b.id = lb.buy_id`
LEFT JOIN buy b ON b.id = lb.buy_id
LEFT JOIN entry e ON e.id = b.entryFk
LEFT JOIN supplier s ON s.id = e.supplierFk`
);
if (ctx.args.tags) {

View File

@ -43,10 +43,21 @@
ng-model="filter.buyerFk"
url="Items/activeBuyers"
show-field="nickname"
search-function="{firstName: $search}"
search-function="{nickname: {like: '%'+ $search +'%'}}"
value-field="workerFk"
label="Buyer">
</vn-autocomplete>
<vn-autocomplete
vn-one
label="Supplier"
ng-model="filter.supplierFk"
url="Suppliers"
fields="['name','nickname']"
search-function="{or: [{nickname: {like: '%'+ $search +'%'}}, {name: {like: '%'+ $search +'%'}}]}"
show-field="name"
value-field="id">
<tpl-item>{{name}}: {{nickname}}</tpl-item>
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal class="vn-pt-sm">
<vn-one class="text-subtitle1" translate>