Merge pull request 'hotfix-sale_getProblems-líneas-redondeo' (!2674) from hotfix-sale_getProblems-líneas-redondeo into master
gitea/salix/pipeline/head This commit looks good Details
gitea/salix/pipeline/pr-test This commit looks good Details

Reviewed-on: #2674
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
Carlos Andrés 2024-07-03 15:26:12 +00:00
commit e202bea92f
1 changed files with 5 additions and 6 deletions

View File

@ -282,8 +282,7 @@ BEGIN
FROM ( FROM (
SELECT tl.ticketFk, SELECT tl.ticketFk,
s.id saleFk, s.id saleFk,
LEFT(GROUP_CONCAT('RE: ',i.id, ' ', IFNULL(i.longName,''), ' '), 250) problem, LEFT(GROUP_CONCAT('RE: ',i.id, ' ', IFNULL(i.longName,'') SEPARATOR ', '), 250) problem
MOD(s.quantity, b.`grouping`) hasRounding
FROM tmp.ticket_list tl FROM tmp.ticket_list tl
JOIN ticket t ON t.id = tl.ticketFk JOIN ticket t ON t.id = tl.ticketFk
AND t.warehouseFk = vWarehouseFk AND t.warehouseFk = vWarehouseFk
@ -291,8 +290,8 @@ BEGIN
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`)
GROUP BY tl.ticketFk GROUP BY tl.ticketFk
HAVING hasRounding
)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;