#6276 createNewWarehouse methods migrated from silex to salix #1850

Merged
jorgep merged 158 commits from 6276-createNewWarehouse into dev 2024-03-06 11:32:11 +00:00
2 changed files with 15 additions and 4 deletions
Showing only changes of commit b33594e0da - Show all commits

View File

@ -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

quitar esta llamada, dentro de item_getInfo ya se llama a barcodeToItem por tanto itemInfo ya contiene el id que se busca

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?

@sergiodt es correcto o quieres los barcodes tambien?
realIdItem: {
inq: realIdItems
}
itemFk: realIdItem
jorgep marked this conversation as resolved Outdated

quitar salto

quitar salto
}
});

View File

@ -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);
});
});