#6276 createNewWarehouse methods migrated from silex to salix #1850
|
@ -30,14 +30,13 @@ module.exports = Self => {
|
|||
const [result] = await Self.rawSql('CALL vn.item_getInfo(?, ?)', [itemFk, warehouseFk]);
|
||||
|
||||
const barcodeItems = await Self.rawSql('SELECT vn.barcodeToItem(?) as realIdItem', [itemFk]);
|
||||
const realIdItems = barcodeItems.map(barcodeItem => barcodeItem.realIdItem);
|
||||
const [realIdItem] = barcodeItems.map(barcodeItem => barcodeItem.realIdItem);
|
||||
|
||||
const barcodes = await models.ItemBarcode.find({
|
||||
fields: ['code'],
|
||||
where: {
|
||||
jorgep marked this conversation as resolved
Outdated
|
||||
realIdItem: {
|
||||
inq: realIdItems
|
||||
}
|
||||
itemFk: realIdItem
|
||||
|
||||
jorgep marked this conversation as resolved
Outdated
jgallego
commented
quitar salto quitar salto
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
const {models} = require('vn-loopback/server/server');
|
||||
|
||||
fdescribe('item card()', () => {
|
||||
const itemFk = 1;
|
||||
const warehouseFk = 1;
|
||||
it('WIP: should get something', async() => {
|
||||
const card = await models.Item.card(itemFk, warehouseFk);
|
||||
|
||||
expect(card).toBeDefined();
|
||||
expect(card.barcodes);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
quitar esta llamada, dentro de item_getInfo ya se llama a barcodeToItem por tanto itemInfo ya contiene el id que se busca
@sergiodt es correcto o quieres los barcodes tambien?