From 28c08d8b18a1b1aad8c7613e931d6f8938a469c2 Mon Sep 17 00:00:00 2001 From: robert Date: Fri, 19 Apr 2024 10:58:19 +0200 Subject: [PATCH 1/3] feat: refs #7237 company_getSuppliersDebt --- db/routines/vn/procedures/company_getSuppliersDebt.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/company_getSuppliersDebt.sql b/db/routines/vn/procedures/company_getSuppliersDebt.sql index 50c64669c..6335ccbe3 100644 --- a/db/routines/vn/procedures/company_getSuppliersDebt.sql +++ b/db/routines/vn/procedures/company_getSuppliersDebt.sql @@ -188,7 +188,7 @@ BEGIN FROM tPendingDuedates vp LEFT JOIN supplier s ON s.id = vp.supplierFk 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 LEFT JOIN supplierAccount sa ON sa.supplierFk = s.id LEFT JOIN bankEntity be ON be.id = sa.bankEntityFk From e0cd08b28033a9d1c4aa0d4164594298f9154ebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Fri, 19 Apr 2024 14:10:11 +0200 Subject: [PATCH 2/3] fix: hotfix importar A3 Ticket 175840 --- db/routines/vn2008/views/payrollWorker.sql | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/db/routines/vn2008/views/payrollWorker.sql b/db/routines/vn2008/views/payrollWorker.sql index d4ada9aa0..6199e98b8 100644 --- a/db/routines/vn2008/views/payrollWorker.sql +++ b/db/routines/vn2008/views/payrollWorker.sql @@ -1,6 +1,9 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` SQL SECURITY DEFINER - VIEW `vn2008`.`payroll_employee` -AS SELECT `pw`.`workerFkA3` AS `CodTrabajador`, - `pw`.`companyFkA3` AS `codempresa` -FROM `vn`.`payrollWorker` `pw` + VIEW `vn2008`.`payroll_employee` AS +SELECT + `pw`.`workerFkA3` AS `CodTrabajador`, + `pw`.`companyFkA3` AS `codempresa`, + `pw`.`workerFk` AS `workerFk` +FROM + `vn`.`payrollWorker` `pw`; \ No newline at end of file From 65892625d5462e48feb0d182104317ad61fcf052 Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 19 Apr 2024 14:17:49 +0200 Subject: [PATCH 3/3] feat: #7231 Collection_assing more time and throw --- db/routines/vn/procedures/collection_assign.sql | 7 +++---- db/routines/vn/procedures/collection_new.sql | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/db/routines/vn/procedures/collection_assign.sql b/db/routines/vn/procedures/collection_assign.sql index bfc7b0f93..f6000e87d 100644 --- a/db/routines/vn/procedures/collection_assign.sql +++ b/db/routines/vn/procedures/collection_assign.sql @@ -3,7 +3,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`collection_assign`( vUserFk INT, OUT vCollectionFk INT ) -proc:BEGIN +BEGIN /** * Comprueba si existen colecciones libres que se ajustan * al perfil del usuario y le asigna la más antigua. @@ -16,7 +16,7 @@ proc:BEGIN DECLARE vItemPackingTypeFk VARCHAR(1); DECLARE vWarehouseFk INT; DECLARE vLockName VARCHAR(215); - DECLARE vLockTime INT DEFAULT 15; + DECLARE vLockTime INT DEFAULT 30; DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN @@ -39,7 +39,6 @@ proc:BEGIN IF vHasTooMuchCollections THEN CALL util.throw('Hay colecciones pendientes'); - LEAVE proc; END IF; SELECT warehouseFk, itemPackingTypeFk @@ -54,7 +53,7 @@ proc:BEGIN ); IF NOT GET_LOCK(vLockName, vLockTime) THEN - LEAVE proc; + CALL util.throw(CONCAT('Cannot get lock: ', vLockName)); END IF; -- Se eliminan las colecciones sin asignar que estan obsoletas diff --git a/db/routines/vn/procedures/collection_new.sql b/db/routines/vn/procedures/collection_new.sql index 1292707af..f3767ddf3 100644 --- a/db/routines/vn/procedures/collection_new.sql +++ b/db/routines/vn/procedures/collection_new.sql @@ -1,6 +1,6 @@ DELIMITER $$ 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. * @@ -26,7 +26,7 @@ proc:BEGIN DECLARE vHasUniqueCollectionTime BOOL; DECLARE vDone INT DEFAULT FALSE; DECLARE vLockName VARCHAR(215); - DECLARE vLockTime INT DEFAULT 15; + DECLARE vLockTime INT DEFAULT 30; DECLARE vFreeWagonFk INT; DECLARE c1 CURSOR FOR @@ -86,7 +86,7 @@ proc:BEGIN ); IF NOT GET_LOCK(vLockName, vLockTime) THEN - LEAVE proc; + CALL util.throw(CONCAT('Cannot get lock: ', vLockName)); END IF; -- Se prepara el tren, con tantos vagones como sea necesario.