#6276 createNewWarehouse methods migrated from silex to salix #1850
|
@ -3047,9 +3047,6 @@ INSERT INTO `vn`.`clientSms` (`id`, `clientFk`, `smsFk`, `ticketFk`)
|
|||
|
||||
-- NEW WAREHOUSE
|
||||
|
||||
/* UPDATE vn.packaging
|
||||
SET id='--'
|
||||
WHERE id='pallet 100'; */
|
||||
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);
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ module.exports = Self => {
|
|||
|
||||
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) {
|
||||
itemShelvings = itemShelvings.map(itemShelving => {
|
||||
|
@ -58,7 +58,7 @@ module.exports = Self => {
|
|||
const shelving = itemShelving.shelving();
|
||||
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 {
|
||||
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() => {
|
||||
try {
|
||||
await models.ExpeditionPallet.getPallet(ctx, 1);
|
||||
await models.ExpeditionPallet.getPallet(ctx, 600);
|
||||
} catch (e) {
|
||||
const error = e;
|
||||
|
||||
|
|
Loading…
Reference in New Issue