7969-plantTray #2982

Merged
pako merged 3 commits from 7969-plantTray into master 2024-09-17 10:56:01 +00:00
4 changed files with 24 additions and 8 deletions

View File

@ -3180,7 +3180,7 @@ UPDATE vn.department
SET workerFk = null;
INSERT INTO vn.packaging
VALUES('--', 2745600.00, 100.00, 120.00, 220.00, 0.00, 1, '2001-01-01 00:00:00.000', NULL, NULL, NULL, 0.00, 16, 0.00, 0, NULL, 0.00, NULL, NULL, 0, NULL, 0, 0);
VALUES('--', 2745600.00, 100.00, 120.00, 220.00, 0.00, 1, '2001-01-01 00:00:00.000', NULL, NULL, NULL, 0.00, 16, 0.00, 0, NULL, 0.00, NULL, NULL, 0, NULL, 0, 0,0);
INSERT IGNORE INTO vn.intrastat

View File

@ -29,6 +29,8 @@ BEGIN
DECLARE vLockName VARCHAR(215);
DECLARE vLockTime INT DEFAULT 30;
DECLARE vFreeWagonFk INT;
DECLARE vErrorNumber INT;
DECLARE vErrorMsg TEXT;
DECLARE c1 CURSOR FOR
SELECT ticketFk, `lines`, m3
@ -48,6 +50,18 @@ BEGIN
DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
GET DIAGNOSTICS CONDITION 1
vErrorNumber = MYSQL_ERRNO,
vErrorMsg = MESSAGE_TEXT;
CALL util.debugAdd('collection_new', JSON_OBJECT(
'errorNumber', vErrorNumber,
'errorMsg', vErrorMsg,
'lockName', vLockName,
'userFk', vUserFk,
'ticketFk', vTicketFk
)); -- Tmp
IF vLockName IS NOT NULL THEN
DO RELEASE_LOCK(vLockName);
END IF;
@ -180,9 +194,10 @@ BEGIN
OR (NOT pb.V AND vItemPackingTypeFk = 'V')
OR (pc.isPreviousPreparationRequired AND pb.previousWithoutParking)
OR LENGTH(pb.problem) > 0
OR (pb.lines > vLinesLimit AND vLinesLimit 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);
OR pb.lines > vLinesLimit
OR pb.m3 > vVolumeLimit
OR sub.maxSize > vSizeLimit
OR pb.hasPlantTray;
END IF;
-- Es importante que el primer ticket se coja en todos los casos

View File

@ -274,9 +274,8 @@ proc: BEGIN
JOIN buy b ON b.id = lb.buy_id
JOIN packaging p ON p.id = b.packagingFk
JOIN productionConfig pc
SET hasPlantTray = TRUE
WHERE ic.code = 'plant'
AND p.`depth` >= pc.minPlantTrayLength
SET pb.hasPlantTray = TRUE
WHERE p.isPlantTray
AND pb.isOwn;
DROP TEMPORARY TABLE

View File

@ -0,0 +1,2 @@
-- Place your SQL code here
ALTER TABLE vn.packaging ADD IF NOT EXISTS isPlantTray BOOL DEFAULT FALSE NOT NULL COMMENT 'The container is a plant tray. Used to restrict the picking of full plant trays, to make previous picking.';