From 9768ce658fc5c0e5588de6103f20927a8cef5190 Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 22 Nov 2024 11:27:10 +0100 Subject: [PATCH] feat: refs #8139 Added if is campaign --- .../vn/procedures/workerTimeControl_clockIn.sql | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/db/routines/vn/procedures/workerTimeControl_clockIn.sql b/db/routines/vn/procedures/workerTimeControl_clockIn.sql index e2549d415..29edc903c 100644 --- a/db/routines/vn/procedures/workerTimeControl_clockIn.sql +++ b/db/routines/vn/procedures/workerTimeControl_clockIn.sql @@ -75,16 +75,11 @@ BEGIN SET vDated = DATE(vTimed); - SELECT EXISTS ( - SELECT TRUE FROM campaign - WHERE vTimed BETWEEN dated - INTERVAL scopeDays DAY AND dated - ) INTO vIsCampaing; - SELECT IF(pc.code = 'driverCE', wc.dayBreakDriver, wc.dayBreak), wc.shortWeekBreak, - IF(vIsCampaing, NULL, wc.longWeekBreak), + wc.longWeekBreak, wc.weekScope, wc.dayMaxTime, wc.maxWorkShortCycle, @@ -244,6 +239,11 @@ BEGIN CALL util.throw(vErrorCode); END IF; + SELECT EXISTS ( + SELECT id FROM campaign + WHERE vTimed BETWEEN dated - INTERVAL scopeDays DAY AND dated + ) INTO vIsCampaing; + -- VERIFICA DESCANSO SEMANAL WITH wtc AS( (SELECT timed @@ -262,7 +262,7 @@ BEGIN ), wtcBreak AS( SELECT timed, IF(IFNULL(gap, 0) > vShortWeekBreak, TRUE, FALSE) hasShortBreak, - IF(IFNULL(gap, 0) > vLongWeekBreak, TRUE, FALSE) hasLongBreak + IF(IFNULL(gap, 0) > vLongWeekBreak AND NOT vIsCampaing, TRUE, FALSE) hasLongBreak FROM wtcGap ORDER BY timed ), wtcBreakCounter AS(