Merge pull request 'deprecated alertLevel.alertLevel now using alertLevel.id' (#682) from 2950-alertlevel_to_alertlevel_id into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #682
Reviewed-by: Joan Sanchez <joan@verdnatura.es>
This commit is contained in:
Joan Sanchez 2021-06-30 08:29:05 +00:00
commit 5d38488ac1
6 changed files with 19 additions and 20 deletions

View File

@ -254,7 +254,7 @@ module.exports = Self => {
ENGINE = MEMORY
SELECT f.id ticketFk, f.clientFk, f.warehouseFk, f.shipped
FROM tmp.filter f
LEFT JOIN alertLevel al ON al.alertLevel = f.alertLevel
LEFT JOIN alertLevel al ON al.id = f.alertLevel
WHERE (al.code = 'FREE' OR f.alertLevel IS NULL)
AND f.shipped >= CURDATE()`);
stmts.push('CALL ticket_getProblems(FALSE)');

View File

@ -273,7 +273,7 @@ module.exports = Self => {
ENGINE = MEMORY
SELECT f.id ticketFk, f.clientFk, f.warehouseFk, f.shipped
FROM tmp.filter f
LEFT JOIN alertLevel al ON al.alertLevel = f.alertLevel
LEFT JOIN alertLevel al ON al.id = f.alertLevel
WHERE (al.code = 'FREE' OR f.alertLevel IS NULL)
AND f.shipped >= CURDATE()`);
stmts.push('CALL ticket_getProblems(FALSE)');

View File

@ -9,13 +9,12 @@
},
"properties": {
"code": {
"type": "String",
"type": "string"
},
"id": {
"type": "number",
"id": true,
"description": "Identifier"
},
"alertLevel": {
"type": "Number",
"id": true
}
},
"acls": [

View File

@ -9,23 +9,23 @@
"properties": {
"id": {
"id": true,
"type": "Number",
"type": "number",
"forceId": false
},
"name": {
"type": "String",
"type": "string",
"required": false
},
"order": {
"type": "Number",
"type": "number",
"required": false
},
"alertLevel": {
"type": "Number",
"type": "number",
"required": false
},
"code": {
"type": "String",
"type": "string",
"required": false
}
}

View File

@ -9,14 +9,14 @@
"properties": {
"ticketFk": {
"id": true,
"type": "Number",
"type": "number",
"forceId": false
},
"updated": {
"type": "Date"
"type": "date"
},
"alertLevel": {
"type": "Number"
"type": "number"
},
"code": {
"type": "string"

View File

@ -21,7 +21,7 @@ module.exports = app => {
JOIN ticket t ON t.id = e.ticketFk
JOIN warehouse wh ON wh.id = t.warehouseFk AND wh.hasComission
JOIN ticketState ts ON ts.ticketFk = t.id
JOIN alertLevel al ON al.alertLevel = ts.alertLevel
JOIN alertLevel al ON al.id = ts.alertLevel
WHERE al.code = 'PACKED'
AND DATE(t.shipped) BETWEEN DATE_ADD(?, INTERVAL -2 DAY)
AND util.dayEnd(?)
@ -33,7 +33,7 @@ module.exports = app => {
await db.rawSql(`
UPDATE ticket t
JOIN ticketState ts ON t.id = ts.ticketFk
JOIN alertLevel al ON al.alertLevel = ts.alertLevel
JOIN alertLevel al ON al.id = ts.alertLevel
JOIN agencyMode am ON am.id = t.agencyModeFk
JOIN deliveryMethod dm ON dm.id = am.deliveryMethodFk
JOIN zone z ON z.id = t.zoneFk
@ -64,7 +64,7 @@ module.exports = app => {
FROM expedition e
JOIN ticket t ON t.id = e.ticketFk
JOIN ticketState ts ON ts.ticketFk = t.id
JOIN alertLevel al ON al.alertLevel = ts.alertLevel
JOIN alertLevel al ON al.id = ts.alertLevel
WHERE al.code = 'PACKED'
AND t.id = ?
AND t.refFk IS NULL
@ -100,7 +100,7 @@ module.exports = app => {
FROM expedition e
JOIN ticket t ON t.id = e.ticketFk
JOIN ticketState ts ON ts.ticketFk = t.id
JOIN alertLevel al ON al.alertLevel = ts.alertLevel
JOIN alertLevel al ON al.id = ts.alertLevel
WHERE al.code = 'PACKED'
AND t.agencyModeFk IN(?)
AND t.warehouseFk = ?
@ -137,7 +137,7 @@ module.exports = app => {
FROM expedition e
JOIN ticket t ON t.id = e.ticketFk
JOIN ticketState ts ON ts.ticketFk = t.id
JOIN alertLevel al ON al.alertLevel = ts.alertLevel
JOIN alertLevel al ON al.id = ts.alertLevel
WHERE al.code = 'PACKED'
AND t.routeFk = ?
AND t.refFk IS NULL