fix: 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
bf13e85ecc
commit
1fbb84ae9f
|
@ -3047,9 +3047,6 @@ INSERT INTO `vn`.`clientSms` (`id`, `clientFk`, `smsFk`, `ticketFk`)
|
||||||
|
|
||||||
-- NEW WAREHOUSE
|
-- NEW WAREHOUSE
|
||||||
|
|
||||||
/* UPDATE vn.packaging
|
|
||||||
SET id='--'
|
|
||||||
WHERE id='pallet 100'; */
|
|
||||||
INSERT INTO vn.packaging
|
INSERT INTO vn.packaging
|
||||||
VALUES('--', 2745600.00, 100.00, 120.00, 220.00, 0.00, 1, '2001-01-01 00:00:00.000', NULL, NULL, NULL, 0.00, 16, 0.00, 0, NULL, 0.00, NULL, NULL, 0, NULL, 0, 0);
|
VALUES('--', 2745600.00, 100.00, 120.00, 220.00, 0.00, 1, '2001-01-01 00:00:00.000', NULL, NULL, NULL, 0.00, 16, 0.00, 0, NULL, 0.00, NULL, NULL, 0, NULL, 0, 0);
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ module.exports = Self => {
|
||||||
|
|
||||||
let itemShelvings = await models.ItemShelving.find(filterItemShelvings, myOptions);
|
let itemShelvings = await models.ItemShelving.find(filterItemShelvings, myOptions);
|
||||||
|
|
||||||
const alternatives = await models.ItemShelving.rawSql('CALL vn.itemShelving_getAlternatives(?)', [shelvingFk]);
|
const [alternatives] = await models.ItemShelving.rawSql('CALL vn.itemShelving_getAlternatives(?)', [shelvingFk]);
|
||||||
|
|
||||||
if (itemShelvings) {
|
if (itemShelvings) {
|
||||||
itemShelvings = itemShelvings.map(itemShelving => {
|
itemShelvings = itemShelvings.map(itemShelving => {
|
||||||
|
@ -58,7 +58,7 @@ 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);
|
const carros = alternatives.filter(el => el.itemFk == itemShelving.itemFk);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: itemShelving.id,
|
id: itemShelving.id,
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
const {models} = require('vn-loopback/server/server');
|
||||||
|
|
||||||
|
describe('itemShelving return()', () => {
|
||||||
|
beforeAll(async() => {
|
||||||
|
ctx = {
|
||||||
|
accessToken: {userId: 9},
|
||||||
|
req: {
|
||||||
|
headers: {origin: 'http://localhost'},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return a list of items and alternative locations', async() => {
|
||||||
|
const itemShelvings = await models.itemShelving.return('HEJ');
|
||||||
|
|
||||||
|
expect(itemShelvings).toBeDefined();
|
||||||
|
// WIP
|
||||||
|
});
|
||||||
|
});
|
|
@ -21,7 +21,7 @@ describe('expeditonPallet getPallet()', () => {
|
||||||
|
|
||||||
it('should throw an error when the pallet does not exist', async() => {
|
it('should throw an error when the pallet does not exist', async() => {
|
||||||
try {
|
try {
|
||||||
await models.ExpeditionPallet.getPallet(ctx, 1);
|
await models.ExpeditionPallet.getPallet(ctx, 600);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
const error = e;
|
const error = e;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue