refs #6276 itemShelving_return
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
30b63f577f
commit
f2ab44bb8f
|
@ -8,7 +8,7 @@ module.exports = Self => {
|
||||||
required: true,
|
required: true,
|
||||||
}],
|
}],
|
||||||
returns: {
|
returns: {
|
||||||
type: 'object',
|
type: ['object'],
|
||||||
root: true
|
root: true
|
||||||
},
|
},
|
||||||
http: {
|
http: {
|
||||||
|
@ -50,8 +50,7 @@ module.exports = Self => {
|
||||||
|
|
||||||
let itemShelvings = await models.ItemShelving.find(filterItemShelvings, myOptions);
|
let itemShelvings = await models.ItemShelving.find(filterItemShelvings, myOptions);
|
||||||
|
|
||||||
let alternatives = await models.ItemShelving.rawSql('CALL vn.itemShelving_getAlternatives(?)', [shelvingFk]);
|
const alternatives = await models.ItemShelving.rawSql('CALL vn.itemShelving_getAlternatives(?)', [shelvingFk]);
|
||||||
console.log(alternatives);
|
|
||||||
|
|
||||||
if (itemShelvings) {
|
if (itemShelvings) {
|
||||||
itemShelvings = itemShelvings.map(itemShelving => {
|
itemShelvings = itemShelvings.map(itemShelving => {
|
||||||
|
@ -59,19 +58,23 @@ module.exports = Self => {
|
||||||
const shelving = itemShelving.shelving();
|
const shelving = itemShelving.shelving();
|
||||||
const parking = shelving ? shelving.parking() : null;
|
const parking = shelving ? shelving.parking() : null;
|
||||||
|
|
||||||
|
const carros = alternatives.filter(el => el.item == itemShelving.itemFk);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
id: itemShelving.id,
|
||||||
item: itemShelving.itemFk,
|
item: itemShelving.itemFk,
|
||||||
description: item ? item.longName || `${item.name} ${item.size}` : '',
|
longName: item ? item.longName || `${item.name} ${item.size}` : '',
|
||||||
visible: itemShelving.visible,
|
quantity: itemShelving.visible,
|
||||||
stickers: Math.ceil(itemShelving.visible / itemShelving.packing),
|
stickers: Math.ceil(itemShelving.visible / itemShelving.packing),
|
||||||
packing: itemShelving.packing,
|
packing: itemShelving.packing,
|
||||||
grouping: itemShelving.grouping,
|
grouping: itemShelving.grouping,
|
||||||
code: parking ? parking.code : '',
|
code: parking ? parking.code : '',
|
||||||
id: itemShelving.id,
|
|
||||||
priority: shelving ? shelving.priority : 0,
|
priority: shelving ? shelving.priority : 0,
|
||||||
isChecked: itemShelving.isChecked
|
isChecked: itemShelving.isChecked,
|
||||||
|
carros
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
return itemShelvings;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue