Compare commits

...

4 Commits

Author SHA1 Message Date
Robert Ferrús f699f64caa Merge branch 'dev' into 8071-travelWeeklyClone
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-10-29 06:45:57 +00:00
Sergio De la torre 6bf186ca66 Merge pull request 'feat: refs #7922 refs #792 scanOrder' (!3157) from 7922-scanOrder into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3157
Reviewed-by: Carlos Andrés <carlosap@verdnatura.es>
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-10-29 06:45:11 +00:00
Sergio De la torre a8cc417fb4 Merge branch 'dev' into 7922-scanOrder
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-10-29 06:32:32 +00:00
Sergio De la torre 11e13fdb20 feat: refs #7922 refs #792 scanOrder
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-10-25 06:40:06 +02:00
4 changed files with 11 additions and 1 deletions

View File

@ -16,7 +16,8 @@ BEGIN
a.nickname,
sub2.itemPackingTypeConcat,
est.code,
es.isScanned
es2.isScanned,
es2.scanOrder
FROM expedition e
JOIN ticket t ON t.id = e.ticketFk
JOIN ticketState ts ON ts.ticketFk = e.ticketFk
@ -38,6 +39,7 @@ BEGIN
SELECT MAX(id)
FROM expeditionState es
WHERE expeditionFk = e.id)
LEFT JOIN expeditionState es2 ON es2.id = es.id
WHERE t.routeFk = vRouteFk AND e.freightItemFk <> FALSE
ORDER BY r.created, t.priority DESC;
END$$

View File

@ -0,0 +1,3 @@
USE vn;
ALTER TABLE vn.expeditionState ADD scanOrder int(11) DEFAULT NULL NULL COMMENT 'Indica la posición al cargar la furgoneta';

View File

@ -44,6 +44,7 @@ module.exports = Self => {
const typeFk = expeditionStateType.id;
expeditionId = expedition.expeditionFk;
expeditionPosition = expedition?.scanOrder ?? null;
const isScannedExpedition = expedition.isScanned ?? false;
await models.ExpeditionState.create({
@ -51,6 +52,7 @@ module.exports = Self => {
typeFk,
userFk: userId,
isScanned: isScannedExpedition,
scanOrder: expeditionPosition
}, myOptions);
}

View File

@ -27,6 +27,9 @@
},
"isScanned": {
"type": "boolean"
},
"scanOrder": {
"type": "number"
}
},
"relations": {