7965-unifyProblems #2990

Open
carlosap wants to merge 20 commits from 7965-unifyProblems into dev
2 changed files with 11 additions and 1 deletions
Showing only changes of commit 638a8e344d - Show all commits

View File

@ -30,6 +30,7 @@ BEGIN
saleFk INT(11),
hasItemShortage BOOL DEFAULT FALSE,
hasItemLost BOOL DEFAULT FALSE,
hasComponentLack BOOL DEFAULT FALSE,
hasItemDelay BOOL DEFAULT FALSE,
hasRounding BOOL DEFAULT FALSE,
PRIMARY KEY (saleFk)
@ -115,6 +116,15 @@ BEGIN
GROUP BY s.id
ON DUPLICATE KEY UPDATE hasItemLost = TRUE;
-- Componentes: Algún componente obligatorio no se ha calcualdo
INSERT INTO tmp.saleProblems(saleFk, hasComponentLack)
SELECT s.id, TRUE
FROM tmp.sale ts
JOIN sale s ON s.id = ts.saleFk
WHERE FIND_IN_SET('hasComponentLack', s.problem)
GROUP BY s.id
ON DUPLICATE KEY UPDATE hasComponentLack = TRUE;
-- Retraso: Disponible suficiente, pero no visible ni ubicado
INSERT INTO tmp.saleProblems(saleFk, hasItemDelay)
SELECT s.id, TRUE

View File

@ -69,7 +69,7 @@ BEGIN
SELECT s.ticketFk
FROM tmp.saleProblems sp
JOIN vn.sale s ON s.id = sp.saleFk
WHERE FIND_IN_SET('hasComponentLack', s.problem)
WHERE sp.hasComponentLack
GROUP BY s.ticketFk
)SELECT tt.ticketFk,
FIND_IN_SET('isFreezed', t.problem) isFreezed,