8144-devToTest_2448 #3216

Merged
alexm merged 256 commits from 8144-devToTest_2448 into test 2024-11-19 07:36:04 +00:00
5 changed files with 14 additions and 2 deletions
Showing only changes of commit 6c40934f74 - Show all commits

View File

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

View File

@ -62,7 +62,7 @@ BEGIN
END IF; END IF;
CALL entry_cloneHeader(vAuxEntryFk, vNewEntryFk, vNewTravelFk); CALL entry_cloneHeader(vAuxEntryFk, vNewEntryFk, vNewTravelFk);
CALL entry_copyBuys(vAuxEntryFk, vNewEntryFk); CALL entry_copyBuys(vAuxEntryFk, vNewEntryFk);
SELECT evaNotes INTO vEvaNotes SELECT evaNotes INTO vEvaNotes
FROM entry FROM entry
@ -71,6 +71,8 @@ BEGIN
UPDATE entry UPDATE entry
SET evaNotes = vEvaNotes SET evaNotes = vEvaNotes
WHERE id = vNewEntryFk; WHERE id = vNewEntryFk;
CALL buy_recalcPricesByEntry(vNewEntryFk);
END LOOP; END LOOP;
SET @isModeInventory = FALSE; SET @isModeInventory = FALSE;

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

View File

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