fix: refs #7213 change rounding problems #2943

Merged
guillermo merged 4 commits from 7213-changeRoundingProblem into master 2024-09-11 10:33:01 +00:00
1 changed files with 5 additions and 5 deletions
Showing only changes of commit 8fd7c1a8dd - Show all commits

View File

@ -208,18 +208,18 @@ BEGIN
INSERT INTO tmp.sale_problems(ticketFk, hasRounding, saleFk)
SELECT ticketFk, problem ,saleFk
guillermo marked this conversation as resolved
Review

SELECT ticketFk, problem, saleFk

SELECT ticketFk, problem, saleFk
FROM (
SELECT tl.ticketFk,
SELECT sgp.ticketFk,
s.id saleFk,
LEFT(GROUP_CONCAT('RE: ',i.id, ' ', IFNULL(i.longName,'') SEPARATOR ', '), 250) problem
FROM tmp.ticket_list tl
JOIN ticket t ON t.id = tl.ticketFk
FROM tmp.sale_getProblems sgp
JOIN ticket t ON t.id = sgp.ticketFk
AND t.warehouseFk = vWarehouseFk
JOIN sale s ON s.ticketFk = tl.ticketFk
JOIN sale s ON s.ticketFk = sgp.ticketFk
JOIN item i ON i.id = s.itemFk
JOIN tmp.buyUltimate bu ON bu.itemFk = s.itemFk
JOIN buy b ON b.id = bu.buyFk
WHERE MOD(s.quantity, b.`grouping`)
GROUP BY tl.ticketFk
GROUP BY sgp.ticketFk
)sub
ON DUPLICATE KEY UPDATE hasRounding = sub.problem, saleFk = sub.saleFk;
END LOOP;