This commit is contained in:
parent
ccc644c298
commit
75293fbb9a
|
@ -21,7 +21,6 @@ BEGIN
|
|||
SELECT barcodeToItem(vBarcode) INTO vItemFk;
|
||||
|
||||
SET vPacking = COALESCE(vPacking, GREATEST(vn.itemPacking(vBarcode,vWarehouseFk), 1));
|
||||
|
||||
SET vQuantity = vQuantity * vPacking;
|
||||
|
||||
IF (SELECT COUNT(*) FROM shelving WHERE code = vShelvingFk COLLATE utf8_unicode_ci) = 0 THEN
|
||||
|
|
|
@ -30,7 +30,7 @@ describe('ItemShelving upsertItem()', () => {
|
|||
await tx.rollback();
|
||||
});
|
||||
|
||||
xit('should add two new records', async() => {
|
||||
it('should add two new records', async () => {
|
||||
const shelvingFk = 'ZPP';
|
||||
const items = [1, 1, 1, 2];
|
||||
|
||||
|
@ -40,17 +40,18 @@ describe('ItemShelving upsertItem()', () => {
|
|||
expect(itemShelvings.length).toEqual(2);
|
||||
});
|
||||
|
||||
xit('should update the visible items', async() => {
|
||||
it('should update the visible items', async () => {
|
||||
const shelvingFk = 'GVC';
|
||||
const items = [2, 2];
|
||||
const {visible: itemsBefore} = await models.ItemShelving.findOne({
|
||||
const { visible: visibleItemsBefore } = await models.ItemShelving.findOne({
|
||||
where: { shelvingFk, itemFk: items[0] }
|
||||
}, options);
|
||||
await models.ItemShelving.upsertItem(ctx, shelvingFk, items, warehouseFk, options);
|
||||
const {visible: itemsAfter} = await models.ItemShelving.findOne({
|
||||
|
||||
const { visible: visibleItemsAfter } = await models.ItemShelving.findOne({
|
||||
where: { shelvingFk, itemFk: items[0] }
|
||||
}, options);
|
||||
|
||||
expect(itemsAfter).toEqual(itemsBefore + 2);
|
||||
expect(visibleItemsAfter).toEqual(visibleItemsBefore + 2);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue