Merge pull request 'feat: refs #7712 sizeLimit' (!2797) from 7712-sizeLimit into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #2797 Reviewed-by: Pako Natek <pako@verdnatura.es>
This commit is contained in:
commit
c1810eaccf
|
@ -9,10 +9,11 @@ BEGIN
|
||||||
DECLARE vWarehouseFk INT;
|
DECLARE vWarehouseFk INT;
|
||||||
DECLARE vWagons INT;
|
DECLARE vWagons INT;
|
||||||
DECLARE vTrainFk INT;
|
DECLARE vTrainFk INT;
|
||||||
DECLARE vLinesLimit INT DEFAULT NULL;
|
DECLARE vLinesLimit INT;
|
||||||
DECLARE vTicketLines INT;
|
DECLARE vTicketLines INT;
|
||||||
DECLARE vVolumeLimit DECIMAL DEFAULT NULL;
|
DECLARE vVolumeLimit DECIMAL;
|
||||||
DECLARE vTicketVolume DECIMAL;
|
DECLARE vTicketVolume DECIMAL;
|
||||||
|
DECLARE vSizeLimit INT;
|
||||||
DECLARE vMaxTickets INT;
|
DECLARE vMaxTickets INT;
|
||||||
DECLARE vStateFk VARCHAR(45);
|
DECLARE vStateFk VARCHAR(45);
|
||||||
DECLARE vFirstTicketFk INT;
|
DECLARE vFirstTicketFk INT;
|
||||||
|
@ -77,6 +78,7 @@ BEGIN
|
||||||
o.trainFk,
|
o.trainFk,
|
||||||
o.linesLimit,
|
o.linesLimit,
|
||||||
o.volumeLimit,
|
o.volumeLimit,
|
||||||
|
o.sizeLimit,
|
||||||
pc.collection_new_lockname
|
pc.collection_new_lockname
|
||||||
INTO vMaxTickets,
|
INTO vMaxTickets,
|
||||||
vHasUniqueCollectionTime,
|
vHasUniqueCollectionTime,
|
||||||
|
@ -88,6 +90,7 @@ BEGIN
|
||||||
vTrainFk,
|
vTrainFk,
|
||||||
vLinesLimit,
|
vLinesLimit,
|
||||||
vVolumeLimit,
|
vVolumeLimit,
|
||||||
|
vSizeLimit,
|
||||||
vLockName
|
vLockName
|
||||||
FROM productionConfig pc
|
FROM productionConfig pc
|
||||||
JOIN worker w ON w.id = vUserFk
|
JOIN worker w ON w.id = vUserFk
|
||||||
|
@ -172,6 +175,14 @@ BEGIN
|
||||||
JOIN state s ON s.id = pb.state
|
JOIN state s ON s.id = pb.state
|
||||||
JOIN agencyMode am ON am.id = pb.agencyModeFk
|
JOIN agencyMode am ON am.id = pb.agencyModeFk
|
||||||
JOIN agency a ON a.id = am.agencyFk
|
JOIN agency a ON a.id = am.agencyFk
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT pb.ticketFk, MAX(i.`size`) maxSize
|
||||||
|
FROM tmp.productionBuffer pb
|
||||||
|
JOIN ticket t ON t.id = pb.ticketfk
|
||||||
|
JOIN sale s ON s.ticketFk = t.id
|
||||||
|
JOIN item i ON i.id = s.itemFk
|
||||||
|
GROUP BY pb.ticketFk
|
||||||
|
) sub ON sub.ticketFk = pb.ticketFk
|
||||||
JOIN productionConfig pc
|
JOIN productionConfig pc
|
||||||
WHERE pb.shipped <> util.VN_CURDATE()
|
WHERE pb.shipped <> util.VN_CURDATE()
|
||||||
OR (pb.ubicacion IS NULL AND a.isOwn)
|
OR (pb.ubicacion IS NULL AND a.isOwn)
|
||||||
|
@ -183,8 +194,9 @@ BEGIN
|
||||||
OR (NOT pb.V AND vItemPackingTypeFk = 'V')
|
OR (NOT pb.V AND vItemPackingTypeFk = 'V')
|
||||||
OR (pc.isPreviousPreparationRequired AND pb.previousWithoutParking)
|
OR (pc.isPreviousPreparationRequired AND pb.previousWithoutParking)
|
||||||
OR LENGTH(pb.problem) > 0
|
OR LENGTH(pb.problem) > 0
|
||||||
OR (pb.lines >= vLinesLimit AND vLinesLimit IS NOT NULL)
|
OR (pb.lines > vLinesLimit AND vLinesLimit IS NOT NULL)
|
||||||
OR (pb.m3 >= vVolumeLimit AND vVolumeLimit IS NOT NULL);
|
OR (pb.m3 > vVolumeLimit AND vVolumeLimit IS NOT NULL)
|
||||||
|
OR ((sub.maxSize > vSizeLimit OR sub.maxSize IS NOT NULL) AND vSizeLimit IS NOT NULL);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
-- Es importante que el primer ticket se coja en todos los casos
|
-- Es importante que el primer ticket se coja en todos los casos
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
ALTER TABLE vn.operator
|
||||||
|
ADD COLUMN sizeLimit int(10) unsigned DEFAULT 90 NULL COMMENT 'Límite de altura en una colección para la asignación de pedidos' AFTER volumeLimit,
|
||||||
|
MODIFY COLUMN linesLimit int(10) unsigned DEFAULT 20 NULL COMMENT 'Límite de lineas en una colección para la asignación de pedidos';
|
Loading…
Reference in New Issue