7152-devToTest_2414 #2228

Merged
alexm merged 636 commits from 7152-devToTest_2414 into test 2024-03-28 08:26:34 +00:00
9 changed files with 17 additions and 19 deletions
Showing only changes of commit 2a6abffef9 - Show all commits

View File

@ -16,7 +16,6 @@ module.exports = Self => {
Self.assignCollection = async(ctx, options) => {
const userId = ctx.req.accessToken.userId;
const myOptions = {userId};
const $t = ctx.req.__;
if (typeof options == 'object')
Object.assign(myOptions, options);
@ -26,7 +25,7 @@ module.exports = Self => {
const [assignedCollection] = await Self.rawSql('SELECT @vCollectionFk');
const {'@vCollectionFk': collectionFk} = assignedCollection;
if (!collectionFk) throw new UserError($t('There are not picking tickets'));
if (!collectionFk) throw new UserError('There are not picking tickets');
await Self.rawSql('CALL vn.collection_printSticker(?, NULL)', [collectionFk], myOptions);
return collectionFk;

View File

@ -29,9 +29,9 @@ module.exports = Self => {
let fields = ['id', 'appName'];
if (workerFk)
fields = [...fields, ...['isVersionBetaCritical', 'versionBeta', 'urlBeta']];
fields = fields.concat(['isVersionBetaCritical', 'versionBeta', 'urlBeta']);
else
fields = [...fields, ...['isVersionCritical', 'version', 'urlProduction']];
fields = fields.concat(['isVersionCritical', 'version', 'urlProduction']);
const filter = {
where: {
@ -40,6 +40,6 @@ module.exports = Self => {
fields,
};
return await Self.findOne(filter);
return Self.findOne(filter);
};
};

View File

@ -212,7 +212,7 @@
"This worker does not exist": "This worker does not exist",
"this state does not exist": "This state does not exist",
"The line could not be marked": "The line could not be marked",
"The sale can not be tracked": "The sale can not be tracked",
"The sale cannot be tracked": "The sale cannot be tracked",
"Shelving not valid": "Shelving not valid",
"printerNotExists": "The printer does not exist",
"There are not picking tickets": "There are not picking tickets",

View File

@ -347,7 +347,7 @@
"This worker does not exist": "Este trabajador no existe",
"this state does not exist": "Este estado no existe",
"The line could not be marked": "No se ha podido marcar la línea",
"The sale can not be tracked": "La línea no puede ser rastreada",
"The sale cannot be tracked": "La línea no puede ser rastreada",
"Shelving not valid": "Carro no válido",
"printerNotExists": "No existe la impresora",
"There are not picking tickets": "No hay tickets para sacar",

View File

@ -36,7 +36,6 @@ module.exports = Self => {
fields: ['code'],
where: {
itemFk: realIdItem
}
});

View File

@ -90,12 +90,12 @@ module.exports = Self => {
const buy = await models.Buy.findById(buyFk, myOptions);
if (buy.itemOriginalFk) await models.SaleBuy.create({saleFk, buyFk}, myOptions);
} catch (e) {
throw new UserError($t('The sale can not be tracked'));
throw new UserError($t('The sale cannot be tracked'));
}
if (tx) await tx.commit();
} catch (e) {
if (e.message == $t('The sale can not be tracked')) {
if (e.message == $t('The sale cannot be tracked')) {
if (tx) tx.commit();
throw e;
}

View File

@ -79,7 +79,7 @@ describe('saleTracking mark()', () => {
} catch (e) {
const error = e;
expect(error.message).toEqual('The sale can not be tracked');
expect(error.message).toEqual('The sale cannot be tracked');
await tx.rollback();
}
});

View File

@ -50,14 +50,17 @@ describe('ticket setDeleted()', () => {
return value;
};
const ticketId = 23;
await models.Ticket.setDeleted(ctx, ticketId, options);
const [sectorCollection] = await models.Ticket.rawSql(
const [sectorCollectionBefore] = await models.Ticket.rawSql(
`SELECT COUNT(*) numberRows
FROM vn.sectorCollection`, [], options);
expect(sectorCollection.numberRows).toEqual(1);
await models.Ticket.setDeleted(ctx, ticketId, options);
const [sectorCollectionAfter] = await models.Ticket.rawSql(
`SELECT COUNT(*) numberRows
FROM vn.sectorCollection`, [], options);
expect(sectorCollectionAfter.numberRows).toEqual(sectorCollectionBefore.numberRows - 1);
await tx.rollback();
} catch (e) {

View File

@ -12,9 +12,6 @@
"id": true,
"description": "Identifier"
},
"truckFk": {
"type": "number"
},
"built": {
"type": "date"
},