feat: refs #174903 item_getSimilar #2326

Merged
robert merged 5 commits from 174903-item_getSimilar into master 2024-04-22 08:53:59 +00:00
5 changed files with 15 additions and 13 deletions
Showing only changes of commit e8d7f20221 - Show all commits

View File

@ -3,7 +3,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`collection_assign`(
vUserFk INT, vUserFk INT,
OUT vCollectionFk INT OUT vCollectionFk INT
) )
proc:BEGIN BEGIN
/** /**
* Comprueba si existen colecciones libres que se ajustan * Comprueba si existen colecciones libres que se ajustan
* al perfil del usuario y le asigna la más antigua. * al perfil del usuario y le asigna la más antigua.
@ -16,7 +16,7 @@ proc:BEGIN
DECLARE vItemPackingTypeFk VARCHAR(1); DECLARE vItemPackingTypeFk VARCHAR(1);
DECLARE vWarehouseFk INT; DECLARE vWarehouseFk INT;
DECLARE vLockName VARCHAR(215); DECLARE vLockName VARCHAR(215);
DECLARE vLockTime INT DEFAULT 15; DECLARE vLockTime INT DEFAULT 30;
DECLARE EXIT HANDLER FOR SQLEXCEPTION DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN BEGIN
@ -39,7 +39,6 @@ proc:BEGIN
IF vHasTooMuchCollections THEN IF vHasTooMuchCollections THEN
CALL util.throw('Hay colecciones pendientes'); CALL util.throw('Hay colecciones pendientes');
LEAVE proc;
END IF; END IF;
SELECT warehouseFk, itemPackingTypeFk SELECT warehouseFk, itemPackingTypeFk
@ -54,7 +53,7 @@ proc:BEGIN
); );
IF NOT GET_LOCK(vLockName, vLockTime) THEN IF NOT GET_LOCK(vLockName, vLockTime) THEN
LEAVE proc; CALL util.throw(CONCAT('Cannot get lock: ', vLockName));
END IF; END IF;
-- Se eliminan las colecciones sin asignar que estan obsoletas -- Se eliminan las colecciones sin asignar que estan obsoletas

View File

@ -1,6 +1,6 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`collection_new`(vUserFk INT, OUT vCollectionFk INT) CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`collection_new`(vUserFk INT, OUT vCollectionFk INT)
proc:BEGIN BEGIN
/** /**
* Genera colecciones de tickets sin asignar trabajador. * Genera colecciones de tickets sin asignar trabajador.
* *
@ -26,7 +26,7 @@ proc:BEGIN
DECLARE vHasUniqueCollectionTime BOOL; DECLARE vHasUniqueCollectionTime BOOL;
DECLARE vDone INT DEFAULT FALSE; DECLARE vDone INT DEFAULT FALSE;
DECLARE vLockName VARCHAR(215); DECLARE vLockName VARCHAR(215);
DECLARE vLockTime INT DEFAULT 15; DECLARE vLockTime INT DEFAULT 30;
DECLARE vFreeWagonFk INT; DECLARE vFreeWagonFk INT;
DECLARE c1 CURSOR FOR DECLARE c1 CURSOR FOR
@ -86,7 +86,7 @@ proc:BEGIN
); );
IF NOT GET_LOCK(vLockName, vLockTime) THEN IF NOT GET_LOCK(vLockName, vLockTime) THEN
LEAVE proc; CALL util.throw(CONCAT('Cannot get lock: ', vLockName));
END IF; END IF;
-- Se prepara el tren, con tantos vagones como sea necesario. -- Se prepara el tren, con tantos vagones como sea necesario.

View File

@ -188,7 +188,7 @@ BEGIN
FROM tPendingDuedates vp FROM tPendingDuedates vp
LEFT JOIN supplier s ON s.id = vp.supplierFk LEFT JOIN supplier s ON s.id = vp.supplierFk
LEFT JOIN client c ON c.fi = s.nif LEFT JOIN client c ON c.fi = s.nif
JOIN clientRisk cr ON cr.clientFk = c.id LEFT JOIN clientRisk cr ON cr.clientFk = c.id
AND cr.companyFk = vp.companyFk AND cr.companyFk = vp.companyFk
LEFT JOIN supplierAccount sa ON sa.supplierFk = s.id LEFT JOIN supplierAccount sa ON sa.supplierFk = s.id
LEFT JOIN bankEntity be ON be.id = sa.bankEntityFk LEFT JOIN bankEntity be ON be.id = sa.bankEntityFk

View File

@ -39,7 +39,7 @@ BEGIN
UPDATE vn.itemShelving UPDATE vn.itemShelving
SET isChecked = vIsChecked SET isChecked = vIsChecked
WHERE shelvingFk COLLATE utf8_unicode_ci = vShelvingFk WHERE shelvingFk COLLATE utf8_unicode_ci = vShelvingFk
AND itemFk = vItemFk; AND itemFk = vItemFk AND isChecked IS NULL;
SET vCounter = vCounter + 1; SET vCounter = vCounter + 1;
END WHILE; END WHILE;

View File

@ -1,6 +1,9 @@
CREATE OR REPLACE DEFINER=`root`@`localhost` CREATE OR REPLACE DEFINER=`root`@`localhost`
SQL SECURITY DEFINER SQL SECURITY DEFINER
VIEW `vn2008`.`payroll_employee` VIEW `vn2008`.`payroll_employee` AS
AS SELECT `pw`.`workerFkA3` AS `CodTrabajador`, SELECT
`pw`.`companyFkA3` AS `codempresa` `pw`.`workerFkA3` AS `CodTrabajador`,
FROM `vn`.`payrollWorker` `pw` `pw`.`companyFkA3` AS `codempresa`,
`pw`.`workerFk` AS `workerFk`
FROM
`vn`.`payrollWorker` `pw`;