This commit is contained in:
parent
a95475ef61
commit
baa1498923
|
@ -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,13 @@ 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
|
||||||
|
) 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 +193,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,8 @@
|
||||||
|
ALTER TABLE vn.operator
|
||||||
|
ADD sizeLimit int(10) unsigned DEFAULT 90 NULL
|
||||||
|
COMMENT 'Límite de altura en una colección para la asignación de pedidos'
|
||||||
|
AFTER volumeLimit;
|
||||||
|
|
||||||
|
ALTER TABLE vn.operator
|
||||||
|
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