QA refactor
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
jorgebl 2021-02-24 14:49:58 +01:00
parent d551389d3a
commit f1c481de64
4 changed files with 152 additions and 149 deletions

View File

@ -84,20 +84,20 @@ module.exports = Self => {
: {or: [{'i.name': {like: `%${value}%`}}, codeWhere]};
case 'id':
return {'i.id': value};
case 'category':
return {'ic.name': value};
case 'salesPersonFk':
return {'t.workerFk': value};
case 'type':
return {'i.typeFk': value};
case 'isActive':
return {'i.isActive': value};
case 'multiplier':
return {'i.stemMultiplier': value};
case 'typeFk':
return {'i.typeFk': value};
case 'category':
return {'ic.name': value};
case 'salesPersonFk':
return {'it.workerFk': value};
case 'origin':
return {'ori.code': value};
case 'niche':
return {'itn.code': value};
return {'ip.code': value};
case 'intrastat':
return {'intr.description': value};
}
@ -108,7 +108,8 @@ module.exports = Self => {
let stmt;
stmt = new ParameterizedSQL(
`SELECT i.id,
`SELECT
i.id,
i.image,
i.name,
i.description,
@ -121,30 +122,30 @@ module.exports = Self => {
i.tag10, i.value10,
i.subName,
i.isActive,
t.name type,
i.typeFk as type,
t.workerFk buyerFk,
u.name userName,
intr.description AS intrastat,
i.stems,
ori.code AS origin,
ic.name AS category,
i.density,
i.stemMultiplier,
i.typeFk,
it.name AS typeName,
it.workerFk AS buyerFk,
u.name AS userName,
ori.code AS origin,
ic.name AS category,
intr.description AS intrastat,
b.grouping,
b.packing,
itn.code AS niche, @visibleCalc
ip.code AS niche, @visibleCalc
FROM item i
LEFT JOIN itemType t ON t.id = i.typeFk
LEFT JOIN itemCategory ic ON ic.id = t.categoryFk
LEFT JOIN worker w ON w.id = t.workerFk
LEFT JOIN itemType it ON it.id = i.typeFk
LEFT JOIN itemCategory ic ON ic.id = it.categoryFk
LEFT JOIN worker w ON w.id = it.workerFk
LEFT JOIN account.user u ON u.id = w.userFk
LEFT JOIN intrastat intr ON intr.id = i.intrastatFk
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 = t.warehouseFk
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 itemPlacement itn ON itn.itemFk = i.id AND itn.warehouseFk = t.warehouseFk`
LEFT JOIN itemPlacement ip ON ip.itemFk = i.id AND ip.warehouseFk = it.warehouseFk`
);
if (ctx.args.tags) {

View File

@ -117,8 +117,7 @@
vn-one
min="0"
label="Multiplier"
ng-model="$ctrl.item.stemMultiplier"
rule>
ng-model="$ctrl.item.stemMultiplier">
</vn-input-number>
</vn-horizontal>
<vn-horizontal>

View File

@ -19,7 +19,7 @@
<vn-th field="stems" shrink>Stems</vn-th>
<vn-th field="size" shrink>Size</vn-th>
<vn-th field="niche" shrink>Niche</vn-th>
<vn-th field="type" shrink>Type</vn-th>
<vn-th field="typeFk" shrink>Type</vn-th>
<vn-th field="category" shrink>Category</vn-th>
<vn-th field="intrastat" shrink>Intrastat</vn-th>
<vn-th field="origin" shrink>Origin</vn-th>
@ -64,8 +64,8 @@
<vn-td shrink>{{::item.stems}}</vn-td>
<vn-td shrink>{{::item.size}}</vn-td>
<vn-td shrink>{{::item.niche}}</vn-td>
<vn-td shrink title="{{::item.type}}">
{{::item.type}}
<vn-td shrink title="{{::item.typeName}}">
{{::item.typeName}}
</vn-td>
<vn-td shrink title="{{::item.category}}">
{{::item.category}}
@ -128,7 +128,10 @@
item="$ctrl.itemSelected">
</vn-item-summary>
</vn-popup>
<vn-contextmenu vn-id="contextmenu" targets="['vn-data-viewer']" model="model"
<vn-contextmenu
vn-id="contextmenu"
targets="['vn-data-viewer']"
model="model"
expr-builder="$ctrl.exprBuilder(param, value)">
<slot-menu>
<vn-item translate
@ -143,11 +146,11 @@
</vn-item>
<vn-item translate
ng-if="contextmenu.isFilterAllowed()"
ng-click="contextmenu.removeFilter()" >
ng-click="contextmenu.removeFilter()">
Remove filter
</vn-item>
<vn-item translate
ng-click="contextmenu.removeAllFilters()" >
ng-click="contextmenu.removeAllFilters()">
Remove all filters
</vn-item>
</slot-menu>

View File

@ -16,7 +16,7 @@ class Controller extends Section {
case 'category':
return {'ic.name': value};
case 'salesPersonFk':
return {'t.workerFk': value};
return {'it.workerFk': value};
case 'grouping':
return {'b.grouping': value};
case 'packing':
@ -24,8 +24,8 @@ class Controller extends Section {
case 'origin':
return {'ori.code': value};
case 'niche':
return {'itn.code': value};
case 'type':
return {'ip.code': value};
case 'typeFk':
return {'i.typeFk': value};
case 'intrastat':
return {'intr.description': value};