Merge pull request 'Hotfix changes whit conficts merged incorrectly' (!2829) from Hotfix-changes-whit-conficts-merged-incorrectly into master
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #2829 Reviewed-by: Guillermo Bonet <guillermo@verdnatura.es>
This commit is contained in:
commit
e1dc7a3cb9
|
@ -11,24 +11,29 @@ BEGIN
|
|||
*/
|
||||
DECLARE vSaleFk INT;
|
||||
DECLARE vHasProblem INT;
|
||||
DECLARE vIsProblemCalcNeeded BOOL;
|
||||
DECLARE vDone BOOL;
|
||||
DECLARE vSaleList CURSOR FOR SELECT saleFk, hasProblem FROM tmp.sale;
|
||||
DECLARE vSaleList CURSOR FOR
|
||||
SELECT saleFk, hasProblem, isProblemCalcNeeded
|
||||
FROM tmp.sale;
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||
|
||||
OPEN vSaleList;
|
||||
l: LOOP
|
||||
SET vDone = FALSE;
|
||||
FETCH vSaleList INTO vSaleFk, vHasProblem;
|
||||
FETCH vSaleList INTO vSaleFk, vHasProblem, vIsProblemCalcNeeded;
|
||||
|
||||
IF vDone THEN
|
||||
LEAVE l;
|
||||
END IF;
|
||||
|
||||
UPDATE sale
|
||||
SET problem = CONCAT(
|
||||
SET problem = IF (vIsProblemCalcNeeded,
|
||||
CONCAT(
|
||||
IF(vHasProblem,
|
||||
CONCAT(problem, ',', vProblemCode),
|
||||
REPLACE(problem, vProblemCode , '')))
|
||||
REPLACE(problem, vProblemCode , ''))),
|
||||
NULL)
|
||||
WHERE id = vSaleFk;
|
||||
END LOOP;
|
||||
CLOSE vSaleList;
|
||||
|
|
|
@ -12,24 +12,28 @@ BEGIN
|
|||
*/
|
||||
DECLARE vTicketFk INT;
|
||||
DECLARE vHasProblem INT;
|
||||
DECLARE vIsProblemCalcNeeded BOOL;
|
||||
DECLARE vDone BOOL;
|
||||
DECLARE vTicketList CURSOR FOR SELECT ticketFk, hasProblem FROM tmp.ticket;
|
||||
DECLARE vTicketList CURSOR FOR
|
||||
SELECT ticketFk, hasProblem, isProblemCalcNeeded
|
||||
FROM tmp.ticket;
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||
|
||||
OPEN vTicketList;
|
||||
l: LOOP
|
||||
SET vDone = FALSE;
|
||||
FETCH vTicketList INTO vTicketFk, vHasProblem;
|
||||
FETCH vTicketList INTO vTicketFk, vHasProblem, vIsProblemCalcNeeded;
|
||||
|
||||
IF vDone THEN
|
||||
LEAVE l;
|
||||
END IF;
|
||||
|
||||
UPDATE ticket
|
||||
SET problem = CONCAT(
|
||||
IF(vHasProblem,
|
||||
SET problem = IF(vIsProblemCalcNeeded,
|
||||
CONCAT(IF(vHasProblem,
|
||||
CONCAT(problem, ',', vProblemCode),
|
||||
REPLACE(problem, vProblemCode , '')))
|
||||
REPLACE(problem, vProblemCode , ''))),
|
||||
NULL)
|
||||
WHERE id = vTicketFk;
|
||||
END LOOP;
|
||||
CLOSE vTicketList;
|
||||
|
|
Loading…
Reference in New Issue