fix: refs #7213 change rounding problems #2943
|
@ -208,18 +208,18 @@ BEGIN
|
||||||
INSERT INTO tmp.sale_problems(ticketFk, hasRounding, saleFk)
|
INSERT INTO tmp.sale_problems(ticketFk, hasRounding, saleFk)
|
||||||
SELECT ticketFk, problem ,saleFk
|
SELECT ticketFk, problem ,saleFk
|
||||||
guillermo marked this conversation as resolved
|
|||||||
FROM (
|
FROM (
|
||||||
SELECT tl.ticketFk,
|
SELECT sgp.ticketFk,
|
||||||
s.id saleFk,
|
s.id saleFk,
|
||||||
LEFT(GROUP_CONCAT('RE: ',i.id, ' ', IFNULL(i.longName,'') SEPARATOR ', '), 250) problem
|
LEFT(GROUP_CONCAT('RE: ',i.id, ' ', IFNULL(i.longName,'') SEPARATOR ', '), 250) problem
|
||||||
FROM tmp.ticket_list tl
|
FROM tmp.sale_getProblems sgp
|
||||||
JOIN ticket t ON t.id = tl.ticketFk
|
JOIN ticket t ON t.id = sgp.ticketFk
|
||||||
AND t.warehouseFk = vWarehouseFk
|
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 item i ON i.id = s.itemFk
|
||||||
JOIN tmp.buyUltimate bu ON bu.itemFk = s.itemFk
|
JOIN tmp.buyUltimate bu ON bu.itemFk = s.itemFk
|
||||||
JOIN buy b ON b.id = bu.buyFk
|
JOIN buy b ON b.id = bu.buyFk
|
||||||
WHERE MOD(s.quantity, b.`grouping`)
|
WHERE MOD(s.quantity, b.`grouping`)
|
||||||
GROUP BY tl.ticketFk
|
GROUP BY sgp.ticketFk
|
||||||
)sub
|
)sub
|
||||||
ON DUPLICATE KEY UPDATE hasRounding = sub.problem, saleFk = sub.saleFk;
|
ON DUPLICATE KEY UPDATE hasRounding = sub.problem, saleFk = sub.saleFk;
|
||||||
END LOOP;
|
END LOOP;
|
||||||
|
|
Loading…
Reference in New Issue
SELECT ticketFk, problem, saleFk