#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
4 changed files with 22 additions and 6 deletions
Showing only changes of commit 1fbb84ae9f - Show all commits

View File

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

View File

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

View File

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

View File

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