refs #6964 feat:hasItemOlder
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Sergio De la torre 2024-03-25 08:20:08 +01:00
parent 22f78dbb91
commit a40234ba9b
2 changed files with 3 additions and 3 deletions

View File

@ -53,7 +53,7 @@ module.exports = Self => {
AND (p.code <> ? OR ? IS NULL)
AND (ish.shelvingFk <> ? OR ? IS NULL)
AND (ish.itemFk <> ? OR ? IS NULL)`,
[shelvingFkIn, parking, parking, shelvingFkOut, shelvingFkOut, itemFk, itemFk]);
[shelvingFkIn, parking, parking, shelvingFkOut, shelvingFkOut, itemFk, itemFk], options);
return result[0]['countItemOlder'] > 0;
};
};

View File

@ -5,7 +5,7 @@ describe('itemShelving hasOlder()', () => {
it('should return false because there are not older items', async() => {
const shelvingFkIn = 'GVC';
const shelvingFkOut = 'HEJ';
const result = await models.ItemShelving.hasItemOlder(shelvingFkIn, shelvingFkOut);
const result = await models.ItemShelving.hasItemOlder(shelvingFkIn, null, shelvingFkOut);
expect(result).toBe(false);
});
@ -33,7 +33,7 @@ describe('itemShelving hasOlder()', () => {
await itemShelvingBefore.updateAttributes({
itemFk: itemFk
});
const result = await models.ItemShelving.hasItemOlder(shelvingFkIn, parking);
const result = await models.ItemShelving.hasItemOlder(shelvingFkIn, parking, null, null, myOptions);
expect(result).toBe(true);
await tx.rollback();