Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2024-02-01 12:17:48 +01:00
commit a9a1f97366
5 changed files with 26 additions and 22 deletions

3
Jenkinsfile vendored
View File

@ -20,6 +20,9 @@ pipeline {
stage('Checkout') {
steps {
script {
// Uncomment to enable debugging
//env.DEBUG = 'strong-remoting:http-context,strong-remoting:shared-method'
switch (env.BRANCH_NAME) {
case 'dev':
env.NODE_ENV = 'dev'

View File

@ -22,6 +22,7 @@ services:
- 3000
environment:
- NODE_ENV
- DEBUG
configs:
- source: datasources
target: /etc/salix/datasources.json

View File

@ -72,24 +72,25 @@ module.exports = Self => {
async function createGestDoc(id) {
const ticket = await models.Ticket.findById(id,
{include: [
{
relation: 'warehouse',
scope: {
fields: ['id']
{
include: [
{
relation: 'warehouse',
scope: {
fields: ['id']
}
}, {
relation: 'client',
scope: {
fields: ['name']
}
}, {
relation: 'route',
scope: {
fields: ['id']
}
}
}, {
relation: 'client',
scope: {
fields: ['name']
}
}, {
relation: 'route',
scope: {
fields: ['id']
}
}
]
]
}, myOptions);
const dmsType = await models.DmsType.findOne({where: {code: 'Ticket'}, fields: ['id']}, myOptions);
const ctxUploadFile = Object.assign({}, ctx);
@ -125,17 +126,17 @@ module.exports = Self => {
if (await gestDocExists(ticketId))
throw new UserError('Ticket is already signed');
if (location) setLocation(ticketId);
if (location) await setLocation(ticketId);
if (!gestDocCreated) await createGestDoc(ticketId);
await models.TicketDms.create({ticketFk: ticketId, dmsFk: dms[0].id}, myOptions);
const ticket = await models.Ticket.findById(ticketId, null, myOptions);
await ticket.updateAttribute('isSigned', true, myOptions);
const deliveryState = await models.State.find({
const deliveryState = await models.State.findOne({
where: {
code: 'DELIVERED'
}
}, options);
}, myOptions);
await models.Ticket.state(ctx, {
ticketFk: ticketId,

View File

@ -18,7 +18,6 @@ module.exports = {
}
},
async serverPrefetch() {
await this.rawSql('SET @hasPrevia := 0');
let ticketIds;
const res = await this.rawSqlFromDef('tickets', [this.id]);
if (res.length) {

View File

@ -16,7 +16,7 @@ SELECT c.itemPackingTypeFk code,
DATE_FORMAT(t.shipped, '%d/%m/%y') shipped,
tt.labelCount,
t.nickName,
SUM(IF(sgd.id, IF(@hasPrevia, 0, @hasPrevia := 1), 1)) lineCount,
SUM(IF(sgd.id IS NULL, 1, 0)) + IF(sgd.id , 1, 0) lineCount,
rm.routeFk
FROM vn.ticket t
JOIN vn.ticketCollection tc ON tc.ticketFk = t.id